[Scons-users] Unnecessary memoization invalidation

Mathew Robinson mathew at chasinglogic.io
Mon Dec 9 09:30:10 EST 2019


Hello all,

While doing build system performance work at MongoDB I've found a few 
areas where the memoization isn't shared between threads (similar to 
the ninfo bug I resolved a few months back) and most importantly that 
Node._clear_memoized_values is being called a little too aggressively.

By removing a few call sites of Node._clear_memoized_values I was able 
to remove a few thousand extra calls to stat which had perf benefits 
for our build. I didn't measure the impact on every memoized value. 
Given the sensitivity and difficulty of caching I wanted to reach out 
here before sending a PR.

Additionally I noticed that for commands that don't change and in 
WhereIs there is no memoization. This causes  ~60 - 100 thousand 
unnecessary stat calls for our builds. I'd like to memoize WhereIs at a 
minimum as well, though that change is unrelated to the above.

Thanks,
- Mathew Robinson @chasinglogic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20191209/814de734/attachment.html>


More information about the Scons-users mailing list