Rev 2481: (John Arbash Meinel) make 'install_bundle' significantly faster by only validating the revisions 1 time, rather than validating all revisions n times. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Fri May 4 04:46:23 BST 2007
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 2481
revision-id: pqm at pqm.ubuntu.com-20070504034556-wzcw478l7qkppkq0
parent: pqm at pqm.ubuntu.com-20070503194912-pzlcms91kk2uqfdo
parent: john at arbash-meinel.com-20070503164230-y0411liq6w3bphj0
committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2007-05-04 04:45:56 +0100
message:
(John Arbash Meinel) make 'install_bundle' significantly faster by only validating the revisions 1 time, rather than validating all revisions n times.
modified:
bzr bzr.py-20050313053754-5485f144c7006fa6
bzrlib/bundle/bundle_data.py read_changeset.py-20050619171944-c0d95aa685537640
------------------------------------------------------------
revno: 2476.2.1
merged: john at arbash-meinel.com-20070503164230-y0411liq6w3bphj0
parent: pqm at pqm.ubuntu.com-20070502125159-zpnij2o99tlddedp
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: install_bundle_performance
timestamp: Thu 2007-05-03 11:42:30 -0500
message:
Vastly improve bundle install performance by only validating the bundle one time
=== modified file 'bzr'
--- a/bzr 2007-04-17 04:39:12 +0000
+++ b/bzr 2007-05-03 16:42:30 +0000
@@ -79,7 +79,8 @@
import bzrlib.decorators
if ('--lsprof' in sys.argv
or '--lsprof-file' in sys.argv
- or '--profile' in sys.argv):
+ or '--profile' in sys.argv
+ or '--lsprof-timed' in sys.argv):
bzrlib.decorators.use_pretty_decorators()
else:
bzrlib.decorators.use_fast_decorators()
=== modified file 'bzrlib/bundle/bundle_data.py'
--- a/bzrlib/bundle/bundle_data.py 2007-04-25 17:49:44 +0000
+++ b/bzrlib/bundle/bundle_data.py 2007-05-03 16:42:30 +0000
@@ -109,6 +109,9 @@
self.timestamp = None
self.timezone = None
+ # Have we checked the repository yet?
+ self._validated_revisions_against_repo = False
+
def __str__(self):
return pprint.pformat(self.__dict__)
@@ -180,7 +183,8 @@
revision = self.get_revision(revision_id)
base = self.get_base(revision)
assert base != revision_id
- self._validate_references_from_repository(repository)
+ if not self._validated_revisions_against_repo:
+ self._validate_references_from_repository(repository)
revision_info = self.get_revision_info(revision_id)
inventory_revision_id = revision_id
bundle_tree = BundleTree(repository.revision_tree(base),
@@ -262,6 +266,7 @@
warning('Not all revision hashes could be validated.'
' Unable validate %d hashes' % len(missing))
mutter('Verified %d sha hashes for the bundle.' % count)
+ self._validated_revisions_against_repo = True
def _validate_inventory(self, inv, revision_id):
"""At this point we should have generated the BundleTree,
More information about the bazaar-commits
mailing list