[MERGE] Support for getting un-annotated content

John Arbash Meinel john at arbash-meinel.com
Wed Dec 6 23:12:04 GMT 2006


For iter_lines_added_or_present_in_versions we only care about the
actual text content for all of those lines. We don't care about the
annotations, or how the lines are grouped.

The attached patch adds 2 new functions to Knit*Factory.
get_fulltext_content() and get_linedelta_content(). Which both yield the
actual line content one by one.

The biggest benefit from this, is that we don't have to fake annotation
information for inventory files, and then just throw it away again. And
for KnitAnnotateFactory we avoid calling decode_utf8() for every line.

This saves another 250ms or so during fileids_altered_by_revision_ids.
So I'm now down to around 7s instead of being at 18s if you have
followed all of my patches.


This patch also changes fileids_altered_by... so that it uses local
variables for things inside the for loop, rather than global variables
or members of other functions. Which also shows a very noticeable shift
of almost 300ms. (down to 6.7s).

And another 2-300ms (6.4s) by switching _parse_record to reading the
entire contents and then splitting off the header, rather than calling
out to _parse_header which does a single readline, and then doing
readlines() for the rest. It also avoids a encode_utf8 step, because I
realized that we just read in the utf8-encoded value.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: more_knit_tuning.patch
Type: text/x-patch
Size: 15149 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061206/93f7b0ea/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/93f7b0ea/attachment.pgp 


More information about the bazaar mailing list