[MERGE] Optimize revno calculation, revision-info and cat-revision

Aaron Bentley aaron at aaronbentley.com
Mon Mar 31 07:50:22 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

This patch is a followon to my other patch for optimizing revision-id
calculations, and optimizes revno calculations.

I believe that RevisionSpec.in_history is no longer useful.  Very few
commands need to determine a revno.  So it's best to focus on
as_revision_id instead of trying to improve the performance of
RevisionSpec.in_history.

It uses the same extend_partial_history mechanism, except it adds the
ability to stop on reaching a particular revision_id.

In the emacs branch, "bzr revision-info -r -1", best of 4:

Old:
real	0m9.141s
user	0m8.397s
sys	0m0.252s

New
real	0m0.284s
user	0m0.224s
sys	0m0.028s

This is ~ 32x faster.

I also tweaked cat-revision to use as_revision_id.  In the emacs branch:
Old:
real	0m9.039s
user	0m8.345s
sys	0m0.224s

New:
real	0m0.368s
user	0m0.304s
sys	0m0.048s

This is 24x faster.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH8Imu0F+nu1YWqI0RAtQ3AJwMC73w/0C97D6Q2MD96HmIwafg0wCcCGR5
m1jx1SWSi1/txeVQDgOKSGY=
=fFQc
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: revision_id_to_revno-3312.patch
Type: text/x-diff
Size: 23672 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080331/0415da19/attachment.bin 


More information about the bazaar mailing list