OpenTTD / eints

WebTranslator for OpenTTD and its add-ons
GNU General Public License v2.0
5 stars 11 forks source link

Add: use sys.intern() on strings for classes using __slots__ #14

Closed TrueBrain closed 3 years ago

TrueBrain commented 3 years ago

eints has a lot of duplicated strings, especially when loading from JSON. For example, every language has a copy of the base-string it belongs to. Without deduplication, OpenTTD uses ~350MB RAM. With deduplication this drops to ~280MB RAM, a good 60MB RAM gain.