Rev 4382: (vila) Fix blatant performance regression for annotate in gc repos in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue May 26 16:13:41 BST 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4382
revision-id: pqm at pqm.ubuntu.com-20090526151333-3qckrxykl1x7op09
parent: pqm at pqm.ubuntu.com-20090526084851-z5v419bk4ni21res
parent: v.ladeuil+lp at free.fr-20090526133423-l29d7m85g0btbd0h
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2009-05-26 16:13:33 +0100
message:
  (vila) Fix blatant performance regression for annotate in gc repos
modified:
  bzrlib/groupcompress.py        groupcompress.py-20080705181503-ccbxd6xuy1bdnrpu-8
  bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
  bzrlib/repofmt/groupcompress_repo.py repofmt.py-20080715094215-wp1qfvoo7093c8qr-1
    ------------------------------------------------------------
    revno: 4381.1.1
    revision-id: v.ladeuil+lp at free.fr-20090526133423-l29d7m85g0btbd0h
    parent: pqm at pqm.ubuntu.com-20090526084851-z5v419bk4ni21res
    parent: v.ladeuil+lp at free.fr-20090526131259-1p0jo42qobud3fxw
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: trunk
    timestamp: Tue 2009-05-26 15:34:23 +0200
    message:
      Fix blatant performance regression for annotate in gc repos
    modified:
      bzrlib/groupcompress.py        groupcompress.py-20080705181503-ccbxd6xuy1bdnrpu-8
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/repofmt/groupcompress_repo.py repofmt.py-20080715094215-wp1qfvoo7093c8qr-1
    ------------------------------------------------------------
    revno: 4371.2.2
    revision-id: v.ladeuil+lp at free.fr-20090526131259-1p0jo42qobud3fxw
    parent: v.ladeuil+lp at free.fr-20090525190459-ke7qqcbngcg3kcsz
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: 374726-gc-annotate
    timestamp: Tue 2009-05-26 15:12:59 +0200
    message:
      Fix comment as per John's review.
    modified:
      bzrlib/repofmt/groupcompress_repo.py repofmt.py-20080715094215-wp1qfvoo7093c8qr-1
    ------------------------------------------------------------
    revno: 4371.2.1
    revision-id: v.ladeuil+lp at free.fr-20090525190459-ke7qqcbngcg3kcsz
    parent: pqm at pqm.ubuntu.com-20090517161026-97fgnk254qwvj4wf
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: 374726-gc-annotate
    timestamp: Mon 2009-05-25 21:04:59 +0200
    message:
      Start fixing annotate for gc.
      
      * bzrlib/repofmt/groupcompress_repo.py:
      (GCPack.__init__): Mention that code and comment disagree.
      
      * bzrlib/knit.py: 
      Fix typo.
      
      * bzrlib/groupcompress.py:
      (GroupCompressVersionedFiles.annotate): Reuse the graph we already
      acquired from reading the index.
    modified:
      bzrlib/groupcompress.py        groupcompress.py-20080705181503-ccbxd6xuy1bdnrpu-8
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/repofmt/groupcompress_repo.py repofmt.py-20080715094215-wp1qfvoo7093c8qr-1
=== modified file 'bzrlib/groupcompress.py'
--- a/bzrlib/groupcompress.py	2009-04-22 17:18:45 +0000
+++ b/bzrlib/groupcompress.py	2009-05-25 19:04:59 +0000
@@ -1018,15 +1018,19 @@
         else:
             keys = [key]
             parent_map = {key:()}
+        # So we used Graph(self) to load the parent_map, but now that we have
+        # it, we can just query the parent map directly, so create a new Graph
+        # object
+        graph = _mod_graph.Graph(_mod_graph.DictParentsProvider(parent_map))
         head_cache = _mod_graph.FrozenHeadsCache(graph)
         parent_cache = {}
         reannotate = annotate.reannotate
         for record in self.get_record_stream(keys, 'topological', True):
             key = record.key
-            chunks = osutils.chunks_to_lines(record.get_bytes_as('chunked'))
+            lines = osutils.chunks_to_lines(record.get_bytes_as('chunked'))
             parent_lines = [parent_cache[parent] for parent in parent_map[key]]
             parent_cache[key] = list(
-                reannotate(parent_lines, chunks, key, None, head_cache))
+                reannotate(parent_lines, lines, key, None, head_cache))
         return parent_cache[key]
 
     def check(self, progress_bar=None):

=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py	2009-04-29 09:50:57 +0000
+++ b/bzrlib/knit.py	2009-05-25 19:04:59 +0000
@@ -3407,7 +3407,7 @@
         fulltext.)
 
         :return: A list of (key, index_memo) records, suitable for
-            passing to read_records_iter to start reading in the raw data fro/
+            passing to read_records_iter to start reading in the raw data from
             the pack file.
         """
         if key in self._annotated_lines:

=== modified file 'bzrlib/repofmt/groupcompress_repo.py'
--- a/bzrlib/repofmt/groupcompress_repo.py	2009-04-20 08:37:32 +0000
+++ b/bzrlib/repofmt/groupcompress_repo.py	2009-05-26 13:12:59 +0000
@@ -87,8 +87,8 @@
             # have a regular 2-list index giving parents and compression
             # source.
             index_builder_class(reference_lists=1),
-            # Texts: compression and per file graph, for all fileids - so two
-            # reference lists and two elements in the key tuple.
+            # Texts: per file graph, for all fileids - so one reference list
+            # and two elements in the key tuple.
             index_builder_class(reference_lists=1, key_elements=2),
             # Signatures: Just blobs to store, no compression, no parents
             # listing.




More information about the bazaar-commits mailing list