[RFC/MERGE] quick hack for bzr log

John Arbash Meinel john at arbash-meinel.com
Fri Mar 14 15:43:54 GMT 2008


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

So it seems that "bzr log" is using "Branch.revision_history()" which
has an inefficient implementation on packs. Specifically it goes through
the Knit layer and calls get_parents() a bunch of times. Which for packs
requires a double index lookup to check for ghosts.

This rewrites it to use a Graph object.

It then does a quick hack to Pack repositories so that their
CachingParentsProvider gets to be reused as long as the lock is held.

On the Emacs repository this changes "bzr log --limit 10" time to 7s
down from 15s on my laptop. (It does it by changing the 350k lookups
down to 85k for 85k revisions.)

I don't know if it is worth merging as is, but it might be something to
think about.

This is actually based against my "revision_graph" patch which I just
submitted to PQM.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH2p05JdeBCYSNAAMRAoUSAJ0cun4v5pxrsqavLB6Yhe8pRouEAQCfXFb0
EcRFA42ppJit1O6LyRASb7o=
=qdz6
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iter_history.patch
Type: text/x-diff
Size: 5003 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080314/52995de4/attachment.bin 


More information about the bazaar mailing list