[MERGE] lookup revno by iterating history
John Arbash Meinel
john at arbash-meinel.com
Sat Mar 15 07:41:59 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This time with patch. :)
John
=:->
John Arbash Meinel wrote:
> The attached patch changes how RevisionSpec_revno() determines its
> revision id. Basically, it iterates from the tip rather than grabbing
> the whole history and then pulling out a node.
>
> It turns out to not help 'bzr log' because the log.py code calls
> _enumerate_history(). However it makes a big difference for "bzr
> revision-info -r -2". On bzr.dev it changes it from 1.4s => 0.2s. Of
> course, it also revealed that 'revision-info' wasn't locking its branch,
> so revision-info had its own problems.
>
> Regardless, it seems that building the revision_history for bzr.dev
> takes about 1s, which is getting pretty long considering we only have 3k
> revisions.
>
> So I think this is a step in the right direction, even if there are lots
> of other places that will need updating.
>
> This patch also changes Repository.iter_reverse_revision_history() to
> use a Graph and to handle ghosts as they come, rather than multiple
> calls to get_parents() which was filtering the ghosts. It should make
> revision_history() cheaper as well.
>
> In fact, the RevisionSpec change probably slows down 'log' slightly,
> since it is still grabbing the Branch.revision_history() which would
> otherwise be cached. Though the iter_reverse changes more than
> compensate. (In my numbers I save about 400ms. for bzr log --short -r -2).
>
> John
> =:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFH233HJdeBCYSNAAMRAjvoAJ0Q/Qt6nB4InHNMdDoszncXstwXlACfRuO9
zriue3LG25D+jfdYPBEXlgo=
=2THG
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: revision_spec.patch
Type: text/x-diff
Size: 13530 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080315/a935e847/attachment.bin
More information about the bazaar
mailing list