Author Dennis Sweeney
Recipients Dennis Sweeney, Zeturic, ammar2, corona10, josh.r, pmpp, serhiy.storchaka, tim.peters, vstinner
Date 2020-10-13.21:42:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1602625369.85.0.309239722979.issue41972@roundup.psfhosted.org>
In-reply-to
Content
bench_table.txt gives my results (`ref` is Master, `change` is with PR 22679).
The change gives 342 faster cases and 275 slower cases, and 9 cases with no change.

I chose a random word of length 10**6 with a zipf character distribution for the haystack, then 20 random needles (also zipf) of each length and tested those same needles and haystack for both.

I ran then with this:

from lots_of_benches import needles, haystack
needles: list[str]
haystack: str

from pyperf import Runner
runner = Runner()

for needle in needles:
    n = len(needle)
    abbrev = needle if n <= 10 else f"{needle[:10]}..."
    runner.timeit(
        name=f"length={n}, value={abbrev}",
        stmt=f"needle in haystack",
        globals=globals(),
    )
History
Date User Action Args
2020-10-13 21:42:49Dennis Sweeneysetrecipients: + Dennis Sweeney, tim.peters, vstinner, pmpp, serhiy.storchaka, josh.r, ammar2, corona10, Zeturic
2020-10-13 21:42:49Dennis Sweeneysetmessageid: <1602625369.85.0.309239722979.issue41972@roundup.psfhosted.org>
2020-10-13 21:42:49Dennis Sweeneylinkissue41972 messages
2020-10-13 21:42:49Dennis Sweeneycreate