[MERGE][bug #300289] Avoid unnecessary work
John Arbash Meinel
john at arbash-meinel.com
Mon Nov 24 21:33:41 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
I haven't fully understood why, but when branching from a stacked branch
into a standalone branch, it turns out that this "set.difference_update"
was a significant portion of the overall time.
Adding this shortcut drops the time for "bzr branch stacked standalone"
from 3m9s down to 1m45s (approx 40% of the total time.)
My guess is that we are doing something like has_key() on the target
index (which is being built). (I see 203k calls to
BTreeBuilder.iter_entries().) Also, in a bit of testing that I did, it
seems that set.difference_update() *always* iterates the full target,
even when source is small.
For example "small_set.difference_update(large_set)" is relatively slow.
(Of course, calling it 172k times doesn't help.)
I'm still investigating more fixes for stacked branches, but this was a
small patch that made a big difference.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the bazaar