Skip to content

Conversation

@cozdas
Copy link
Owner

@cozdas cozdas commented Apr 18, 2024

Adding options to turn off various features to reduce OCIO size

  • OCIO_LUT_SUPPORT
  • OCIO_ARCHIVE_SUPPORT
  • OCIO_USE_HALF_LOOKUP_TABLE

When all are turned off, the dll size goes down from 4468 KB to 2381 KB

cozdas added 6 commits April 17, 2024 17:32
…on and off.

- added OCIO_ARCHIVE_SUPPORT preprocessor switch

- And the library now compiles with or without LUT and/or OCIOZ support, shaving off 40% of dll size.
… and baking the values in the OpenColorABI.h, where it makes more sense.
…conversion LUT just through the preprocessor macros without re-compiling the imath library. So exposed OCIO_USE_HALF_LOOKUP_TABLE cmake option to turn it on/off
…med by what.

- Looks like in some files (such as ocioyaml.cpp) the string manipulation for exception messages takes ~30% of the binary.
- Also heavy usage of smart pointers and other dereferencing is contributing to a degree (std::shared_pt, yaml iterators). It'd be a good idea to extract raw pointers and use them if they will be used many many times within a function)
- With changing some of the functions, it's possible to help compiler to do return value optimizations.
- Also some back and forth string conversions (between std::string, char*, std::stringstream etc) in many places, we can implement overloads of functions taking different variants, limiting the conversion code to a single instance.
- some more ideas
@cozdas cozdas marked this pull request as ready for review May 15, 2025 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants