[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-----
Hash: SHA1

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.

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

iEYEARECAAYFAkkrHasACgkQJdeBCYSNAAMSngCgtxgP0xG8649CwsP+tJ4R8c7o
lQ0AnRSgJuPHGgXOQHhtlSBzpjH/L7Sc
=M5i0
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: builder_iter_entries.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20081124/8f0edb38/attachment.diff 


More information about the bazaar mailing list