[MERGE] improvements to parse_line_delta_iter

John Arbash Meinel john at arbash-meinel.com
Wed Dec 6 20:34:21 GMT 2006


The current Knit.parse_line_delta is written such that it takes a list,
and slowly removes lines from the beginning of this list. This is wrong
because:

1) It means the list you pass in is destroyed, so if you want to keep
it, you have to do a copy.

2) It is slow to pop things off the beginning of a list. So it is better
to pull them off the end. Or better yet, don't pop anything off, and
just iterate using a counter.

I did the latter in this patch. It shaves another 350ms or so off of the
time to iterate through all of my inventory.knit during
fileids_altered_by....

Also, I caught a small bug where parse_line_delta_iter for a different
factory was bogus. It was using function[] rather than function(), but I
changed it around anyway.

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parse_line_delta.patch
Type: text/x-patch
Size: 2484 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061206/4d953014/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/4d953014/attachment.pgp 


More information about the bazaar mailing list