Rev 4683: We can check if old matches first, which gives us a couple more hits. in http://bazaar.launchpad.net/~jameinel/bzr/2.0.1-faster-get-deltas-bug374730

John Arbash Meinel john at arbash-meinel.com
Thu Sep 24 23:15:38 BST 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.0.1-faster-get-deltas-bug374730

------------------------------------------------------------
revno: 4683
revision-id: john at arbash-meinel.com-20090924221525-5vezfwzai1d2ajnn
parent: john at arbash-meinel.com-20090924221050-t6n0cd92ry2s39mp
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.0.1-faster-get-deltas-bug374730
timestamp: Thu 2009-09-24 17:15:25 -0500
message:
  We can check if old matches first, which gives us a couple more hits.
  Down to 49s. Not the <36s I'd like to be at, though...
-------------- next part --------------
=== modified file 'bzrlib/repofmt/groupcompress_repo.py'
--- a/bzrlib/repofmt/groupcompress_repo.py	2009-09-24 22:10:50 +0000
+++ b/bzrlib/repofmt/groupcompress_repo.py	2009-09-24 22:15:25 +0000
@@ -1031,6 +1031,11 @@
 
             tree_path_root_key = \
                 tree.inventory.parent_id_basename_to_file_id.key()
+            if old_path_root_key == interesting_root_key:
+                # Grab this before tree_path_root_key tries to replace it
+                old_interesting_ids = interesting_ids_by_root
+            else:
+                old_interesting_ids = None
             if tree_path_root_key == interesting_root_key:
                 interesting_ids = interesting_ids_by_root
             else:
@@ -1044,9 +1049,10 @@
                 and old_path_root_key is not None):
                 # The old tree had a different tree layout than the current one
                 # so we need to expand again
-                (old_interesting_ids,
-                 _) = old_tree.inventory._expand_fileids_to_parents_and_children(
-                        specific_fileids)
+                if old_interesting_ids is None:
+                    (old_interesting_ids,
+                     _) = old_tree.inventory._expand_fileids_to_parents_and_children(
+                            specific_fileids)
                 # We don't mutate interesting_ids in place, because it is being
                 # cached
                 old_interesting_ids.update(interesting_ids)



More information about the bazaar-commits mailing list