AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO
Not using SEARCH_REFERENCE_SPACE_ALL results in significantly slower calls
- Lingua principale
- C++
- Stelle
- 2.1k
- Fork
- 503
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Segui getNumColorSpaces e getColorSpaceNameByIndex dalla chiamata a PopulateOCIOMenus, quindi esamina StringUtils::Compare, ToLower e il tipo restituito da getName() coinvolto nella ricerca. Esegui un benchmark della configurazione ACES 1.2 sul percorso indicato e verifica che il confronto più veloce mantenga gli stessi risultati riducendo al contempo la regressione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp
- Ambito
- computer-graphics, performance
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100