Rev 3833: Experiment with a 16-way fan out, 64k leaf node structure. in http://bzr.arbash-meinel.com/branches/bzr/brisbane/hack

John Arbash Meinel john at arbash-meinel.com
Thu Dec 25 17:34:55 GMT 2008


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

------------------------------------------------------------
revno: 3833
revision-id: john at arbash-meinel.com-20081225173433-9jd032jltpdqrzw2
parent: john at arbash-meinel.com-20081225151532-52w2hxndu05ttr6z
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: hack
timestamp: Thu 2008-12-25 11:34:33 -0600
message:
  Experiment with a 16-way fan out, 64k leaf node structure.
  
  Initial results show fewer total nodes with better delta compression.
  For the first 1k revisions, it is just as fast, though it seems to be a
  little bit slower further on.
  Unsure what exactly will happen as we include more 'random' nodes, which
  happens as the graph has fewer linear regions in 100 revs.
-------------- next part --------------
=== modified file 'bzrlib/chk_map.py'
--- a/bzrlib/chk_map.py	2008-12-25 15:15:32 +0000
+++ b/bzrlib/chk_map.py	2008-12-25 17:34:33 +0000
@@ -734,16 +734,16 @@
             crc = zlib.crc32(bit)
             # knit.add_lines() doesn't like it when we have an extra '\n' in
             # the line. So we force '\n' out by mapping it to another char.
-            hashed = struct.pack('>i', crc).replace('\n', '_')
-            assert len(hashed) == 4
+            # hashed = struct.pack('>i', crc).replace('\n', '_')
+            # assert len(hashed) == 4
+            # hashed_bits.append(hashed)
+            # hex(-number) == -hex(number) which isn't really what we want
+            if crc < 0:
+                hashed = '%08X' % (-crc,)
+            else:
+                hashed = '%08X' % (crc,)
+            assert len(hashed) == 8
             hashed_bits.append(hashed)
-            ## # hex(-number) == -hex(number) which isn't really what we want
-            ## if crc < 0:
-            ##     hashed = '%08X' % (-crc,)
-            ## else:
-            ##     hashed = '%08X' % (crc,)
-            ## assert len(hashed) == 8
-            ## hashed_bits.append(hashed)
         return '\x00'.join(hashed_bits)
 
     def refs(self):
@@ -1058,16 +1058,16 @@
         hashed_bits = []
         for bit in key:
             crc = zlib.crc32(bit)
-            hashed = struct.pack('>i', crc).replace('\n', '_')
-            assert len(hashed) == 4
+            # hashed = struct.pack('>i', crc).replace('\n', '_')
+            # assert len(hashed) == 4
+            # hashed_bits.append(hashed)
+            # hex(-number) == -hex(number) which isn't really what we want
+            if crc < 0:
+                hashed = '%08X' % (-crc,)
+            else:
+                hashed = '%08X' % (crc,)
+            assert len(hashed) == 8
             hashed_bits.append(hashed)
-            ## # hex(-number) == -hex(number) which isn't really what we want
-            ## if crc < 0:
-            ##     hashed = '%08X' % (-crc,)
-            ## else:
-            ##     hashed = '%08X' % (crc,)
-            ## assert len(hashed) == 8
-            ## hashed_bits.append(hashed)
         return '\x00'.join(hashed_bits)[:self._node_width]
         # return ('\x00'.join(key) + '\x00'*self._node_width)[:self._node_width]
 

=== modified file 'bzrlib/chk_serializer.py'
--- a/bzrlib/chk_serializer.py	2008-11-14 01:28:40 +0000
+++ b/bzrlib/chk_serializer.py	2008-12-25 17:34:33 +0000
@@ -63,7 +63,7 @@
         self.parent_id_basename_index = parent_id_basename_index
 
 
-chk_serializer_subtree = CHKSerializerSubtree(4096, False)
-chk_serializer = CHKSerializer(4096, False)
-chk_serializer_subtree_parent_id = CHKSerializerSubtree(4096, True)
-chk_serializer_parent_id = CHKSerializer(4096, True)
+chk_serializer_subtree = CHKSerializerSubtree(65536, False)
+chk_serializer = CHKSerializer(65536, False)
+chk_serializer_subtree_parent_id = CHKSerializerSubtree(65536, True)
+chk_serializer_parent_id = CHKSerializer(65536, True)



More information about the bazaar-commits mailing list