[Final testing with benchmark tests] Fastest String Search Algorithm.

Paul Zimmermann Paul.Zimmermann@inria.fr
Sat Jun 12 08:01:44 GMT 2021


       Dear Amit,

> I ran the benchmark tests for my algorithm and for strstr().
> 
> Total number of tests = 332.
> 
> My algorithm is faster 182 times.
> 
> strstr() is faster 150 times.

and your algorithm can be up to 3531 times slower than strstr():

s: 3.75006e+08				106175

The largest strstr() time is 1.5e6, whereas the largest time of your
algorithm is 9.8e8, i.e., 656 times larger.

Can you improve your algorithm so that the worst case time is similar to that
of strstr()?

Paul


More information about the Libc-alpha mailing list