[MERGE] log performance

John Arbash Meinel john at arbash-meinel.com
Fri Jun 23 18:28:39 BST 2006


Aaron Bentley wrote:
> Hi all,
> 
> This patch optimizes performance of log formatters that don't show
> merges (i.e. --short and --line).
> 
> 1. It adds a new codepath for selecting the revisions to display
> 2. It does not retrieve revisions that will not be displayed
> 
> In my tests (which have a 1:1 ratio of merges to mainline), it goes from
> 190 ms to 109ms, that is 1.74x as fast.
> 
> Aaron

+
+    # convert the revision history to a dictionary:
+    rev_nos = dict([(k, v) for v, k in cut_revs])
+

Martin commented on this, but it is true that you don't have to build up
the list. If you use:
rev_nos = dict((k, v) for v, k in cut_revs)

the dict() can accept a generator. I don't know if it saves a lot, but
it seems like it should.

I also wanted to comment on the 'which have a 1:1 merge ratio'. I think
this is a good start. The current bzr.dev actually has 6500 revisions,
and only 1800 are on mainline. Which gives us 3.5:1.
I realize a lot of this is our workflow of having a central mainline,
and lots of dev branches.

In my testing, your changes have a large effect on --short performance.
Specifically without your patch:
$ time ./bzr log --log-format=short > /dev/null
real    0m3.534s

And with your patch:
$ time ./bzr log --log-format=short > /dev/null
real    0m1.526s

As a reference point, we also have --log-format=long, the time didn't
change with or without your patch.
$ time ./bzr log --log-format=long > /dev/null
real    0m4.501s

Anyway, its already merged, but kudos for the improvement. (2.3x faster)

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060623/3e391dbe/attachment.pgp 


More information about the bazaar mailing list