RFC: caching in CHKInventory

Robert Collins robertc at robertcollins.net
Thu Oct 2 05:50:28 BST 2008


I'm building up a CHKInventory class, which is a demand-loadable
inventory representing a serialised inventory only. (So its not used, or
intended to be used during e.g. commit).

I'm wondering whether to cache, or not. The CHKMap class will cache
(because writing nodes out before all changes are made is expensive, and
we need a way to make-and-update the maps, and our experience with BTree
suggests a small cache is really needed). The CHKMap is currently
mutable to allow creation, but I may make it immutable and create it by
'update-from-empty' using the 'apply delta' operation. There will be 1
or 2 maps per CHKInventory. (path->id, id->path, are the two maps, but
only one is needed to be 'functional' - and I'm at 'make it work').

The apply-delta operation at the inventory level will generate a new
CHKInventory rather than mutating the existing one; which is why I am
pondering caching at all at this level: accessing individual entries is
done by a lookup into a CHKMap, and then a parse operation.

Any strong opinions?

-Rob


-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20081002/46bac270/attachment.pgp 


More information about the bazaar mailing list