Rev 4209: Use a simple dict cache for btree internal_node lookups. in http://bzr.arbash-meinel.com/branches/bzr/jam-integration
John Arbash Meinel
john at arbash-meinel.com
Thu Mar 26 20:55:22 GMT 2009
At http://bzr.arbash-meinel.com/branches/bzr/jam-integration
------------------------------------------------------------
revno: 4209
revision-id: john at arbash-meinel.com-20090326205221-ddrlzj00y65k5t0w
parent: pqm at pqm.ubuntu.com-20090326131816-4nzmlssnd4huc5cu
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: jam-integration
timestamp: Thu 2009-03-26 15:52:21 -0500
message:
Use a simple dict cache for btree internal_node lookups.
-------------- next part --------------
=== modified file 'bzrlib/btree_index.py'
--- a/bzrlib/btree_index.py 2009-03-24 01:53:42 +0000
+++ b/bzrlib/btree_index.py 2009-03-26 20:52:21 +0000
@@ -641,7 +641,11 @@
# Default max size is 100,000 leave values
self._leaf_value_cache = None # lru_cache.LRUCache(100*1000)
self._leaf_node_cache = lru_cache.LRUCache(_NODE_CACHE_SIZE)
- self._internal_node_cache = lru_cache.LRUCache()
+ # We could limit this, but even a 300k record btree has only 3k leaf
+ # nodes, and only 20 internal nodes. So the default of 100 nodes in an
+ # LRU would mean we always cache everything anyway, no need to pay the
+ # overhead of LRU
+ self._internal_node_cache = {}
self._key_count = None
self._row_lengths = None
self._row_offsets = None # Start of each row, [-1] is the end
More information about the bazaar-commits
mailing list