On Tue, Nov 17, 2015 at 09:04:13AM +0100, Jean-Marc Lasgouttes wrote: > Le 17/11/2015 01:38, Scott Kostyshak a écrit : > >>1 << 19 is a 1 with 19 zeros after it, in binary notation, so is equivalent > >>to 2^19 = 512K but much faster to calculate. This trick is used extensively > >>in debug.h. > > > >Thanks for this explanation, Richard. Now I understand. > > > >I'm still curious how 512K was chosen. > > It is completely arbitrary :) This is actually a lower bound for the amount > of memory used, since it does not take into account the extra memory > required by docstring and QCache themselves. > > I will try to find time to tweak this setting, but I am not sure what use > case is the best for that. The important thing for now is that there is an > upper bound on the memory we use for the cache, due to the LRU algorithm in > QCache.
I see. Someday it would be nice to mark places in our code that make somewhat arbitrary decisions. The next step would be to implement some sort of mechanism that would produce a debug log (only enabled for devel mode) that would give information on the optimal value. Scott
signature.asc
Description: PGP signature