[MERGE] LRUCache changes

John Arbash Meinel john at arbash-meinel.com
Mon Dec 8 18:23:31 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This patch adds a few changes to LRUCache

1) Rename an initialization parameter for clarity.
2) Change the default so that "after_cleanup_count" is now 80% of the
max_cache value. The idea is that when we reach a full cache, clearing
out down to 80% is better than staying at 100% the whole time. As it
gives us some room to add more keys before we have to cleanup again. 80%
is pretty much chosen out of thin air, but I still believe it is better
than what we had.
3) Add LRUCache.resize(). This is mostly what I was after. I wanted to
have something that was a sane bound, but still allow me to grow it if
I'm finding that I'm thrashing the cache.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkk9ZiMACgkQJdeBCYSNAAPxFQCfXeugpGlWfe9pA0laanRGgm9A
QzkAoNVw7mCfgA2bVN3QhqYQcpfUHWSj
=qQIc
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lru_cache.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20081208/27d6f65c/attachment-0001.diff 


More information about the bazaar mailing list