Raymond Hettinger wrote:

> > but refactoring the contains code to use find_internal sounds like a good
> > first step. any takers?
>
> I'm up for it.

excellent!

just fyi, unless my benchmark is mistaken, the Unicode implementation has
the same problem:

    str in -> 25.8 �sec per loop
    unicode in -> 26.8 �sec per loop

    str.find() -> 6.73 �sec per loop
    unicode.find() -> 7.24 �sec per loop

oddly enough, if I change the target string so it doesn't contain any partial
matches at all, unicode.find() wins the race:

    str in -> 24.5 �sec per loop
    unicode in -> 24.6 �sec per loop

    str.find() -> 2.86 �sec per loop
    unicode.find() -> 2.16 �sec per loop

</F> 



_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to