Knit record cache considered harmful

Michael Ellerman michael at ellerman.id.au
Fri Jun 23 10:30:24 BST 2006


On 6/23/06, Martin Pool <mbp at canonical.com> wrote:
> On 23 Jun 2006, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> > 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.

I agree. In general I think we need to be careful about creating
caches inside python, after reading this:
http://evanjones.ca/python-memory.html

Executive summary: some types of memory are never freed by the python
interpreter.

If I can be so bold as to define a rule :) .. it should be that we
should only ever have a cache of something if it a) is proven to be
hit some significant percentage of the time, b) saves us doing network
i/o, c) saves large amounts of cpu, or d) overriding all that, is
shown to measureably improve performance.

cheers




More information about the bazaar mailing list