Rev 3895: Different attempt, which I thought would give similar results but doesn't. in http://bzr.arbash-meinel.com/branches/bzr/brisbane/gc_delta_index_room

John Arbash Meinel john at arbash-meinel.com
Wed Mar 18 22:40:59 GMT 2009


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

------------------------------------------------------------
revno: 3895
revision-id: john at arbash-meinel.com-20090318224055-hs7nxyq5fjz0pr19
parent: john at arbash-meinel.com-20090318223201-rpttk4ur07xar0z5
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: gc_delta_index_room
timestamp: Wed 2009-03-18 17:40:55 -0500
message:
  Different attempt, which I thought would give similar results but doesn't.
  Changing it back to EXTRA_NULLS=1 and setting hash map to be twice as wide.
  This results in 9.2k inserts, 1.3k expands, and overall 3m58s.
  Also, the assumption of 'not many added' is patently false.
  The biggest I've seen now is 2.2k insertions, and 2.2k*4k index is going to
  be stupid-painful.
-------------- next part --------------
=== modified file 'bzrlib/diff-delta.c'
--- a/bzrlib/diff-delta.c	2009-03-18 22:32:01 +0000
+++ b/bzrlib/diff-delta.c	2009-03-18 22:40:55 +0000
@@ -28,7 +28,7 @@
 /* The hash map is sized to put 4 entries per bucket, this gives us 2 blank
  * spaces.
  */
-#define EXTRA_NULLS 2
+#define EXTRA_NULLS 1
 
 static const unsigned int T[256] = {
     0x00000000, 0xab59b4d1, 0x56b369a2, 0xfdeadd73, 0x063f6795, 0xad66d344,
@@ -447,7 +447,7 @@
         total_num_entries = num_entries + old->num_entries;
     else
         total_num_entries = num_entries;
-    hsize = total_num_entries / 4;
+    hsize = total_num_entries / 2;
     for (i = 4; (1u << i) < hsize && i < 31; i++);
     hsize = 1 << i;
     hmask = hsize - 1;
@@ -531,7 +531,7 @@
        first byte to allow for optimizing the Rabin's polynomial
        initialization in create_delta(). */
     total_num_entries = num_entries + old_index->num_entries;
-    hsize = total_num_entries / 4;
+    hsize = total_num_entries / 2;
     for (i = 4; (1u << i) < hsize && i < 31; i++);
     hsize = 1 << i;
     if (hsize < old_index->hash_mask) {



More information about the bazaar-commits mailing list