Message378579
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(),
) |
|
Date |
User |
Action |
Args |
2020-10-13 21:42:49 | Dennis Sweeney | set | recipients:
+ Dennis Sweeney, tim.peters, vstinner, pmpp, serhiy.storchaka, josh.r, ammar2, corona10, Zeturic |
2020-10-13 21:42:49 | Dennis Sweeney | set | messageid: <1602625369.85.0.309239722979.issue41972@roundup.psfhosted.org> |
2020-10-13 21:42:49 | Dennis Sweeney | link | issue41972 messages |
2020-10-13 21:42:49 | Dennis Sweeney | create | |
|