forked from AcademySoftwareFoundation/OpenImageIO
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(TS): Reduce TS memory by slimming down internal LevelInfo size (A…
…cademySoftwareFoundation#4337) Reduces the memory footprint of the `LevelInfo` struct. Three changes are here, in order of most to least impactful: - Makes one `ImageSpec` optional, most of the time `spec` and `nativespec` are the same, it appears they are only different when autotile is enabled, this saves about 160 bytes. - Uses `std::unique_ptr<float[]>` (8 bytes) instead of `std::vector<float>` (24 bytes). - Reorders members to remove excess padding. We noticed this memory usage on scenes with per-face textures with multiple mips per face. For a scene with 12.5 million mips, this saves about 2GB. Note, it would probably also be possible to remove the `polecolorcomputed` member, instead relying on the `polecolor` pointer. But since this bool occupies existing padding in the struct it wouldn't save any memory currently. --------- Signed-off-by: Curtis Black <curtis.w.black@gmail.com>
- Loading branch information
1 parent
736d253
commit 5cc8860
Showing
3 changed files
with
61 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters