Rev 5662: (jameinel) Speed up ``Repository.get_parent_map`` by about 10%. (John A in file:///home/pqm/archives/thelove/bzr/2.3/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Sep 1 21:07:51 UTC 2011


At file:///home/pqm/archives/thelove/bzr/2.3/

------------------------------------------------------------
revno: 5662 [merge]
revision-id: pqm at pqm.ubuntu.com-20110901210744-ac0spkg98x42y95k
parent: pqm at pqm.ubuntu.com-20110829181038-21uvn1yzqzf38kws
parent: john at arbash-meinel.com-20110901150049-58egom3qzcj9fves
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.3
timestamp: Thu 2011-09-01 21:07:44 +0000
message:
  (jameinel) Speed up ``Repository.get_parent_map`` by about 10%. (John A
   Meinel)
modified:
  bzrlib/smart/repository.py     repository.py-20061128022038-vr5wy5bubyb8xttk-1
  doc/en/release-notes/bzr-2.3.txt NEWS-20050323055033-4e00b5db738777ff
=== modified file 'bzrlib/smart/repository.py'
--- a/bzrlib/smart/repository.py	2010-11-16 06:06:11 +0000
+++ b/bzrlib/smart/repository.py	2011-09-01 15:00:49 +0000
@@ -236,7 +236,7 @@
                 next_revs = set()
                 break
             # don't query things we've already queried
-            next_revs.difference_update(queried_revs)
+            next_revs = next_revs.difference(queried_revs)
             first_loop_done = True
 
         # sorting trivially puts lexographically similar revision ids together.

=== modified file 'doc/en/release-notes/bzr-2.3.txt'
--- a/doc/en/release-notes/bzr-2.3.txt	2011-08-20 09:28:27 +0000
+++ b/doc/en/release-notes/bzr-2.3.txt	2011-09-01 21:07:44 +0000
@@ -87,6 +87,11 @@
 .. Improvements to existing commands, especially improved performance 
    or memory usage, or better results.
 
+* Tweak an RPC implementation for ``Repository.get_parent_map``, it was
+  doing an inefficient ``small_set.difference_update(large_set)`` when we
+  can do ``small_set = small_set.difference(large_set)``. This speeds up
+  discovery time by about 10%. (John Arbash Meinel)
+
 Bug Fixes
 *********
 




More information about the bazaar-commits mailing list