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

I attached a new PR, with a lot of the same ideas.

The major differences between this and the last PR:

* The first character to be checked at each alignment is the first character of 
the right half, rather than the last.

* If that first character does not match, then the character immediately 
following the window is looked up in the table, and we jump forward accordingly 
(Sunday's trick).

I'll post some more benchmarks soon, but preliminarily, it seems like this 
swapping of the character to first be matched is better for some needles, worse 
for others, which makes sense. Stringbench.py for example has some needles that 
have a unique character at the end, which prefers the status quo and old PR, 
but other strings work better for this PR.

----------

_______________________________________
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