[merge] Knit caches that overflow to disk

John Arbash Meinel john at arbash-meinel.com
Tue Jul 18 01:03:20 BST 2006


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

Attached is a patch which introduces a 'DiskBackedCache' class.
Basically it is a dict that maps to strings, and if the target data gets
too big, it optionally starts writing to disk (either that or not
caching any more data).

The use case is that we need to read the inventory before we know what
file texts to merge, but we don't want to read the inventory a second
time when we actually install the text locally. People using big trees
were concerned about excessive memory consumption. So if the tree is
local, it just stops caching new reads, and if the tree is remote it
starts writing to a temporary file.

I don't know if this will make it into 0.9. Lifeless has a reasonably
valid concern that it is not the best way to handle memory consumption.

But I figured I can put the patch up for review, and interested parties
can take it further if they so desire.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEvCVIJdeBCYSNAAMRAtXAAJ9UqKZX1gAUOWNLJ4K/MXBOk3LTEwCgmLG2
niSNQWEBr2jFcoJz9gnE9Fs=
=athu
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spill-to-disk.diff
Type: text/x-patch
Size: 20102 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060717/e2b68b59/attachment.bin 


More information about the bazaar mailing list