Rev 4210: Switch to using a FIFOCache. in http://bzr.arbash-meinel.com/branches/bzr/jam-integration

John Arbash Meinel john at arbash-meinel.com
Fri Mar 27 04:23:51 GMT 2009


At http://bzr.arbash-meinel.com/branches/bzr/jam-integration

------------------------------------------------------------
revno: 4210
revision-id: john at arbash-meinel.com-20090327042335-5a8ii0h5sa4ktx04
parent: john at arbash-meinel.com-20090326205221-ddrlzj00y65k5t0w
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: jam-integration
timestamp: Thu 2009-03-26 23:23:35 -0500
message:
  Switch to using a FIFOCache.
  
  That gives us the lookup performance of a dict, while still being capped
  at max size.
-------------- next part --------------
=== modified file 'bzrlib/btree_index.py'
--- a/bzrlib/btree_index.py	2009-03-26 20:52:21 +0000
+++ b/bzrlib/btree_index.py	2009-03-27 04:23:35 +0000
@@ -30,6 +30,7 @@
     chunk_writer,
     debug,
     errors,
+    fifo_cache,
     index,
     lru_cache,
     osutils,
@@ -645,7 +646,7 @@
         # 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._internal_node_cache = fifo_cache.FIFOCache(100)
         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