< Previous
More fiddling with SCons, and some more docs >

Trying on SCons:

The profiler found that there are lots of empty dictionaries in instances of SCons.Node.FS.File, so I replaced a few of them with wrappers which only make a real dictionary when needed.

Before the change (output is from scons --debug=memory -n):
Memory before SConscript files: 7516160
Memory after SConscript files: 17731584
Memory before building: 17731584
Memory after building: 23470080

After the change:
Memory before SConscript files: 7520256
Memory after SConscript files: 16392192
Memory before building: 16392192
Memory after building: 21549056

So that small change (writing a lazy dictionary class which took about half an hour, and 28 other lines, mostly changing {} to lazydict()) has reduced memory usage by 2MB out of 24. Which is not bad, but not very big either. I'll have another look later to see what else can be reduced.


[Main]

Unless otherwise noted, all content licensed by Nick Smallbone
under a Creative Commons License.