KnitSequenceMatcher a net performance loss

John Arbash Meinel john at arbash-meinel.com
Mon May 29 09:13:02 BST 2006


Robert Collins wrote:
> On Sun, 2006-05-28 at 21:32 -0500, John Arbash Meinel wrote:
>> I'm not sure why it is, but in my work on performance testing
>> PatienceDiff, I include a test of the KnitSequenceMatcher. And what I
>> found was that KnitSequenceMatcher is actually slower than difflib's
>> plain sequence matcher.

...

> What difflib are you using, perhaps the implementation I copied was a
> greatly slower one ?
> 
> Rob

The one from python 2.4.3. KnitSequenceMatcher only overrides
find_longest_match, and changes the lookup to catch an exception rather
than grabbing an empty list.
Which seems to be the same as 2.4.1

I think the issue is that it depends how often your keys would not
match. If it happens infrequently, then the exception rarely occurs. But
in common case files it happens very often.

If you were profiling with the kernel sized tree, it might just be
because the tree is not really real.

John
=:->

-------------- 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/20060529/e197e215/attachment.pgp 


More information about the bazaar mailing list