~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: John Arbash Meinel
  • Date: 2009-08-16 17:22:08 UTC
  • mto: This revision was merged to the branch mainline in revision 4629.
  • Revision ID: john@arbash-meinel.com-20090816172208-2mh7z0uapy6y0gsv
Expose KnownGraph off of VersionedFiles
handle ghosts (needs tests, doesn't seem to effect performance)
list(tuple[1:]) is a couple ms slower than using my own loop.
Net effect is:
  time bzr log -n0 -r -10..-1
  real    0m2.559s

  time wbzr log -n0 -r -10..-1
  real    0m1.170s

  time bzr log -n1 -r -10..-1
  real    0m0.453s

So the overhead for the extra graph is down from 2.1s to 0.7s

Show diffs side-by-side

added added

removed removed

Lines of Context:
1190
1190
        generator = _VFContentMapGenerator(self, [key])
1191
1191
        return generator._get_content(key)
1192
1192
 
 
1193
    def get_known_graph_ancestry(self, keys):
 
1194
        """Get a KnownGraph instance with the ancestry of keys."""
 
1195
        parent_map, missing_keys = self._index._graph_index.find_ancestry(keys,
 
1196
                                                                          0)
 
1197
        kg = _mod_graph.KnownGraph(parent_map)
 
1198
        return kg
 
1199
 
1193
1200
    def get_parent_map(self, keys):
1194
1201
        """Get a map of the graph parents of keys.
1195
1202