Rev 3803: Add a TODO describing a possible optimization. in http://bzr.arbash-meinel.com/branches/bzr/brisbane/chk_map

John Arbash Meinel john at arbash-meinel.com
Tue Dec 2 23:47:56 GMT 2008


At http://bzr.arbash-meinel.com/branches/bzr/brisbane/chk_map

------------------------------------------------------------
revno: 3803
revision-id: john at arbash-meinel.com-20081202234745-80n34m4wg4gcgx8i
parent: john at arbash-meinel.com-20081202234434-b2ahyaq5vqg6jylz
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: chk_map
timestamp: Tue 2008-12-02 17:47:45 -0600
message:
  Add a TODO describing a possible optimization.
-------------- next part --------------
=== modified file 'bzrlib/chk_map.py'
--- a/bzrlib/chk_map.py	2008-12-02 23:44:34 +0000
+++ b/bzrlib/chk_map.py	2008-12-02 23:47:45 +0000
@@ -948,6 +948,15 @@
         # So far, everything fits. Page in the rest of the nodes, and see if it
         # holds true.
         if keys:
+            # TODO: Consider looping over a limited set of keys (like 25 or so
+            #       at a time). If we have to read more than 25 we almost
+            #       certainly won't fit them all into a single new LeafNode, so
+            #       reading the extra nodes is a waste.
+            #       This will probably matter more with hash serialised keys,
+            #       as we will get InternalNodes with more references.
+            #       The other argument is that unmap() is uncommon, so we don't
+            #       need to optimize it. But map() with a slightly shorter
+            #       value may happen a lot.
             stream = store.get_record_stream(keys, 'unordered', True)
             nodes = []
             # Fully consume the stream, even if we could determine that we



More information about the bazaar-commits mailing list