Fastest String Search Algorithm.

Phil Blundell pb@pbcl.net
Wed Jun 9 14:25:33 GMT 2021


On Wed, Jun 09, 2021 at 07:38:01PM +0530, Amit Choudhary wrote:
> I have done the same tests on my side. I have one text of 60 KB and my
> needle sizes are 3.2 KB, 4.4 KB, 5.9 KB, 7 KB, and 28 KB.
> 
> So, my tests are similar to those of strstr() benchmark.
> 
> Also, I have already mentioned that my algorithm is faster than strstr()
> when needle size is greater than or equal to 4.4 KB.

Right, but I think you've only established that your algorithm is faster
for this one particular haystack and four different needles.  That's not
to say that it isn't faster in other cases, but we don't know that yet.
It's also not clear to me what the upper complexity bound is for your
algorithm and how that compares to the one we have at the moment.

> So, I will spend my time there to evaluate string search algorithms of
> these languages.

That's entirely fair enough.  Thanks for the suggestions anyway.

Phil


More information about the Libc-alpha mailing list