Rev 3367: * Severe performance degradation in fetching from knit repositories to in http://people.ubuntu.com/~robertc/baz2.0/knit-revision-search

Robert Collins robertc at robertcollins.net
Mon Apr 14 23:40:12 BST 2008


At http://people.ubuntu.com/~robertc/baz2.0/knit-revision-search

------------------------------------------------------------
revno: 3367
revision-id: robertc at robertcollins.net-20080414223951-6cnknexu9wfniwno
parent: pqm at pqm.ubuntu.com-20080414205628-khxum18d23suak10
committer: Robert Collins <robertc at robertcollins.net>
branch nick: knit-revision-search
timestamp: Tue 2008-04-15 08:39:51 +1000
message:
   * Severe performance degradation in fetching from knit repositories to
     packs due to parsing the entire revisions.kndx on every graph walk
     iteration fixed by using the Repository.get_graph API. (Robert Collins)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
=== modified file 'NEWS'
--- a/NEWS	2008-04-14 18:38:11 +0000
+++ b/NEWS	2008-04-14 22:39:51 +0000
@@ -23,6 +23,10 @@
 
   BUGFIXES:
 
+    * Severe performance degradation in fetching from knit repositories to
+      packs due to parsing the entire revisions.kndx on every graph walk
+      iteration fixed by using the Repository.get_graph API. (Robert Collins)
+
   DOCUMENTATION:
 
     * Document outlining strategies for TortoiseBzr. (Mark Hammond)

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2008-04-10 06:19:49 +0000
+++ b/bzrlib/repository.py	2008-04-14 22:39:51 +0000
@@ -2385,6 +2385,7 @@
         :return: A set of revision ids.
         """
         graph = self.source.get_graph()
+        target_graph = self.target.get_graph()
         missing_revs = set()
         # ensure we don't pay silly lookup costs.
         revision_ids = frozenset(revision_ids)
@@ -2399,14 +2400,14 @@
                 absent_ids = set(revision_ids.intersection(ghosts))
                 # If all absent_ids are present in target, no error is needed.
                 absent_ids.difference_update(
-                    self.target.has_revisions(absent_ids))
+                    set(target_graph.get_parent_map(absent_ids)))
                 if absent_ids:
                     raise errors.NoSuchRevision(self.source, absent_ids.pop())
             # we don't care about other ghosts as we can't fetch them and
             # haven't been asked to.
             next_revs = set(next_revs)
             # we always have NULL_REVISION present.
-            have_revs = self.target.has_revisions(next_revs).union(null_set)
+            have_revs = set(target_graph.get_parent_map(next_revs)).union(null_set)
             missing_revs.update(next_revs - have_revs)
             searcher.stop_searching_any(have_revs)
         return searcher.get_result()




More information about the bazaar-commits mailing list