"bzr log" slow with revid
John Arbash Meinel
john at arbash-meinel.com
Sat Jul 17 21:15:40 BST 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Eli Zaretskii wrote:
>> Date: Sat, 17 Jul 2010 07:34:18 -0500
>> From: John Arbash Meinel <john at arbash-meinel.com>
>> CC: bazaar at lists.canonical.com
>>
>> Using "bzr --lsprof-file revid.callgrind log -c REVID" and sending us
>> that info would help us to understand what is going on.
>
> Attached below.
>
>> Also, is this revision-id recent or old?
>
> It's 65 revisions old (100769 out of 100834).
>
As a side note, it is usually nicer to attach large files like this,
rather than have them inline in your text.
Anyway, as I guessed, 95% of the time is in Branch.revision_history()
(iterate the whole mainline history and return it.)
It would be possible to change how revspecs looked up their
corresponding info. Something like:
=== modified file 'bzrlib/revisionspec.py'
- --- bzrlib/revisionspec.py 2010-06-24 20:51:59 +0000
+++ bzrlib/revisionspec.py 2010-07-17 20:14:16 +0000
@@ -457,6 +457,7 @@
revid:aaaa at bbbb-123456789 -> Select revision 'aaaa at bbbb-123456789'
"""
+ wants_revision_history = False
prefix = 'revid:'
def _match_on(self, branch, revs):
@@ -464,7 +465,12 @@
# so we expect it to be a Unicode string. Switch it to the internal
# representation.
revision_id = osutils.safe_revision_id(self.spec, warn=False)
- - return RevisionInfo.from_revision_id(branch, revision_id, revs)
+ if revs is not None:
+ return RevisionInfo.from_revision_id(branch, revision_id, revs)
+ try:
+ revno = branch.revision_id_to_revno(revision_id)
+ except errors.NoSuchRevision:
+ return RevisionInfo(branch, None, revision_id)
def _as_revision_id(self, context_branch):
return osutils.safe_revision_id(self.spec, warn=False)
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkxCD2wACgkQJdeBCYSNAAPxVQCfahp7dEL4USMYWlO0L0gK9Kbe
o3MAoJ1E0gZ+7ho2RAJS9kqVPb/pJ1K7
=s1zA
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list