Fastest String Search Algorithm.

Amit Choudhary amitchoudhary0523@gmail.com
Sun Jun 6 14:15:01 GMT 2021


Hi All,

I have invented the fastest string search algorithm. It is called
"Choudhary Algorithm". I am sharing it here, in case glibc wants to include
it in for strstr().

I have compared my algorithm my other standard algorithms and below are the
results.

You can view the results and source code of the algorithm and text/pattern
here: https://sourceforge.net/projects/fastest-string-search-algo/files/

The search text is around 60 KB long and the pattern is 27 bytes.

Result:
---------

Pattern found at index 30384

Time taken by Brute Force algorithm = 57,151,900 ns.
Time taken by Boyer Moore algorithm = 25,012,100 ns.
Time taken by Rabin Karp algorithm = 613,410,200 ns.
Time taken by Knuth Morris Pratt Force algorithm = 58,461,200 ns.
Time taken by Choudhary algorithm = 17,413,000 ns. (Fastest).

Choudhary string search algorithm is the fastest.

-------------------------------------------------------------------------------

Regards,
Amit


More information about the Libc-alpha mailing list