Rev 6028: Play around with when to activate how much history searching. in http://bazaar.launchpad.net/~jameinel/bzr/2.4-too-much-walking-388269

John Arbash Meinel john at arbash-meinel.com
Thu Aug 11 15:44:35 UTC 2011


At http://bazaar.launchpad.net/~jameinel/bzr/2.4-too-much-walking-388269

------------------------------------------------------------
revno: 6028
revision-id: john at arbash-meinel.com-20110811154420-nrcv83c8lh3yl6c3
parent: john at arbash-meinel.com-20110811153030-vciura8b9e04npj3
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.4-too-much-walking-388269
timestamp: Thu 2011-08-11 17:44:20 +0200
message:
  Play around with when to activate how much history searching.
  
  walk all, took 16.685s transferred 2561KiB
  len(100) depth 1, took 18.2s transferred 2813kB
  len(1000) depth 1, took 17.5s transferred 2813kB
  len(1000) depth 10, took 16.7s transferred 2586kB
  len(1000) depth 100, took 17.1s transferred 2559kB
  
  I think because we walk the graph multiple times, depth 100 starts to
  become expensive, but notice that it does decrease bytes-over-the-wire
  slightyl. All of them take 693 steps, so we are finishing with
  roughly the same data that is interesting to us.
  Depth 10 seems to be enough to get most of the walking benefit, and
  not walk lots of data over-and-over again.
  
  Still needs a bit more testing, but has some promise.
-------------- next part --------------
=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2011-07-26 13:28:49 +0000
+++ b/bzrlib/remote.py	2011-08-11 15:44:20 +0000
@@ -1744,8 +1744,14 @@
         if parents_map is None:
             # Repository is not locked, so there's no cache.
             parents_map = {}
-        (start_set, stop_keys,
-         key_count) = graph.search_result_from_parent_map(parents_map,
+        if len(parents_map) > 100:
+            (start_set, stop_keys,
+             key_count) = graph.limited_search_result_from_parent_map(
+                parents_map, self._unstacked_provider.missing_keys,
+                keys, depth=1)
+        else:
+            (start_set, stop_keys,
+             key_count) = graph.search_result_from_parent_map(parents_map,
             self._unstacked_provider.missing_keys)
         recipe = ('manual', start_set, stop_keys, key_count)
         body = self._serialise_search_recipe(recipe)



More information about the bazaar-commits mailing list