oe-lite / core

Official OE-lite/core repository - moved to GitLab.com
https://gitlab.com/oe-lite/core
Other
4 stars 17 forks source link

oelite/meta/dict.py: put our dicts on a diet #203

Closed Villemoes closed 7 years ago

Villemoes commented 7 years ago

It's almost January, so time for the annual diet. Let's include the dicts backing our metadata instances. This cuts 46% of the memory use of the .smpl and .cplx members themselves (not accounting for sizes of keys and values), corresponding to about 10% of the total memory consumption. For an "oe bake world", that translates to around 63 MB of memory with the metalayers I have. It doesn't add any noticable time to the initialization phase.

I admit it's a little hacky, but I think the code-to-comment ratio and the gain should make up for that. It's a shame Python doesn't expose an official knob to do this kind of thing.