Dennis Sweeney <sweeney.dennis...@gmail.com> added the comment:

Here is a C implementation of the two-way algorithm that should work as a 
drop-in replacement for Objects/stringlib/fastsearch.h.

Benchmarking so far, it looks like it is a bit slower in a lot of cases. But 
it's also a bit faster in a some other cases and oodles faster in the really 
bad cases.

I wonder if there's a good heuristic cutoff (for the needle size?) where the 
two-way usually becomes better.

----------
Added file: https://bugs.python.org/file49508/fastsearch.h

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41972>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to