[PATCH] Improve strstr performance of short needles
Siddhesh Poyarekar
siddhesh@gotplt.org
Tue Oct 2 10:39:00 GMT 2018
On 01/10/18 10:35 PM, Wilco Dijkstra wrote:
> However when iterating through 16K needles randomly chosen from natural
> text I get the following speedups for different haystack and needle sizes:
>
> H64 H256 H4096
> N2: 64% 73% 46%
> N3: 74% 66% 37%
> N4: 94% 92% 66%
>
> As you can see the speedup is larger for small needles since the preprocessing
> overhead of the Two-Way algorithm is significant. This is completely hidden by
> the GLIBC test due to using just 1 needle.
Can you please add this test to benchtests?
Thanks,
Siddhesh
More information about the Libc-alpha
mailing list