public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [New Insight] [Polite Mail] Fastest String Search Algorithm.
@ 2021-06-13 20:21 Amit Choudhary
  0 siblings, 0 replies; only message in thread
From: Amit Choudhary @ 2021-06-13 20:21 UTC (permalink / raw)
  To: GNU C Library

[-- Attachment #1: Type: text/plain, Size: 901 bytes --]

Hi,

In case people are interested, else please ignore this mail.

I am writing this mail for the sole purpose to prove my point that
hand crafted inputs (haystack, needle) should not be tested.

I read little bit about the twoway method of strstr() and after little
bit of fiddling with the needle, I found out a complex needle for
worst case scenario where strstr() [Latest strstr() from github as
suggested by someone from glibc] takes more time than my algorithm.

So, for some worst case scenarios my algorithm can perform worse and
for some worst case scenarios strstr() can perform worse.

Details can be provided if needed.

The haystack is 65 KB long and needle is 64 bytes long.

I am attaching the bzipped2 file of haystack and needle.

Also, as usual, my algorithm is slower than strstr() for needles less
than or equal to 1 KB.

I am being polite so I expect polite replies if any.

Amit

[-- Attachment #2: haystack_needle.txt.bz2 --]
[-- Type: application/x-bzip, Size: 167 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-13 20:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-13 20:21 [New Insight] [Polite Mail] Fastest String Search Algorithm Amit Choudhary

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).