AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO
Not using SEARCH_REFERENCE_SPACE_ALL results in significantly slower calls
- Dominant language
- C++
- Stars
- 2.1k
- Forks
- 503
- PR merge metrics
- No merged PRs in 30d
Description
Both `getNumColorSpaces` and `getColorSpaceNameByIndex` become much slower when using `SEARCH_REFERENCE_SPACE_SCENE` for example. For instance when using the ACES 1.2 config, `PopulateOCIOMenus` in `ociodisplay` goes from 0.74s to 8.1s on my windows workstation (see screenshot below).
This is primarily caused by the string comparison function: `ToLower` but also the new string allocation (going from `getName()`'s `const char*` to `const std::string&`

Replacing `StringUtils::Compare` with `::strcmp(...) == 0` cuts most of the cost down (0.9s instead of 8.1s). I think a faster method than the current approach would be needed in cases like these.
Contributor guide
Research direction
Trace getNumColorSpaces and getColorSpaceNameByIndex from the PopulateOCIOMenus call, then inspect StringUtils::Compare, ToLower, and the getName() return type involved in the lookup. Benchmark the ACES 1.2 configuration on the reported path and verify that the faster comparison preserves results while reducing the regression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100