This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <>
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]}..."
        name=f"length={n}, value={abbrev}",
        stmt=f"needle in haystack",
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: <>
2020-10-13 21:42:49Dennis Sweeneylinkissue41972 messages
2020-10-13 21:42:49Dennis Sweeneycreate