[MERGE] shave 10s off of iter_lines_added_or_present...
John Arbash Meinel
john at arbash-meinel.com
Wed Dec 6 20:21:43 GMT 2006
The attached patch fixes a bug in
ter_lines_added_or_present_in_versions. The code was extracting an
in-order queue of versions by doing:
for version_id in self.versions():
if version_id in requested_version_ids:
list.append(version_id)
However, requested_version_ids was a list. And when doing an initial
branch, this list could be 10,000 entries long. Which is *really* slow.
Anyway, the attached patch changes it so that it uses a set, and gets
rid of some of the unused variables.
I have a few more patches coming, which fix "fileids_altered_by..." so
that instead of taking 18s to process the complete bzr.dev inventory, it
is down to around 7s to process.
This single change, though, accounts for about 10 seconds of the
improvement.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iter_lines_added_set.patch
Type: text/x-patch
Size: 1568 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061206/d89384d6/attachment.bin
-------------- 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/20061206/d89384d6/attachment.pgp
More information about the bazaar
mailing list