Knit record cache considered harmful

Martin Pool mbp at canonical.com
Fri Jun 23 08:31:28 BST 2006


On 23 Jun 2006, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> Hi all,
> 
> Many people have noted that building large trees eats gobs and gobs of
> memory.  I suspected the problem was knit caching.
> 
> Michael Ellerman was experiencing this problem, so I sent him a patch
> that cleared the knit caches for each file, during the tree build
> process.  Here are his results:
> 
> http://michael.ellerman.id.au/files/comparison.png

Well done on tracking it down.

> So one option is to disable the cache permanently.  Another is to make
> the cache behave like a proper cache, with limits on size.  Another is
> to make the cache off_by_default.

OK, so I haven't done the experiments you have, but my general approach
would be this: if the cache's purpose is to improve performance, but
there's no benchmark demonstrating that it actually *does* improve
performance, then we should get rid of it.  Whether we do that by
turning it off or actually excising the code depends on what looks
cleaner.

Limiting it by size or age doesn't feel write to me (but I might be
wrong) -- we'll still suffer, but only up to a limit.   But in some
cases we just won't need it at all.

-- 
Martin




More information about the bazaar mailing list