[MERGE] log performance

Aaron Bentley aaron.bentley at utoronto.ca
Fri Jun 23 19:03:53 BST 2006


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

John Arbash Meinel wrote:
> 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 would have thought that generator expressions would be slower than
list comprehensions because of all the function call overhead.  But in
fact, you're right.  It's faster.

> 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.

Not too surprising.

> In my testing, your changes have a large effect on --short performance.

Yeah, I use --short too, and I can feel the difference.

> 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

Yeah, the only chance of changing --long would be by avoiding 6500
hasattr calls.

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

Thanks.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEnC0J0F+nu1YWqI0RAo8NAJwJx1ZXbWvgAXW7LM7ddgU+P0fSQgCfYkHV
toQvERwESG4HW+CSuprvwd4=
=w7Op
-----END PGP SIGNATURE-----




More information about the bazaar mailing list