public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Amit Choudhary <amitchoudhary0523@gmail.com>
To: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [Final testing with benchmark tests] Fastest String Search Algorithm.
Date: Sat, 12 Jun 2021 14:11:53 +0530	[thread overview]
Message-ID: <CAFf+5zg24pQhLqLL0dC43dCEcYiSq4Lhp56oUhVb7EJvgQSYEw@mail.gmail.com> (raw)
In-Reply-To: <mwh7i38qaf.fsf@tomate.loria.fr>

On Sat, Jun 12, 2021 at 1:31 PM Paul Zimmermann <Paul.Zimmermann@inria.fr>
wrote:

>        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
>


I don't think my algorithm can be optimized more. Anyways, I had invented
my algorithm thinking about normal average case scenarios and not for worst
case scenarios.

I was talking with Dr. Moore (inventor of Boyer-Moore algorithm) and he
suggested me to demonstrate that my algorithm is better for average case by
doing exhaustive testing across a wide variety of patterns and texts.

He also told me that he had invented his algorithm for average case too and
not thinking much about worst case scenario.

==================What Dr. Moore said========================
If your algorithm is worse case O(mn) then you should
somehow argue (and demonstrate with exhausting testing
across a wide variety of patterns and texts) that its
``average'' behavior is better!  The point is that the
naive algorithm is worst-case O(mn) and why should a
person use yours rather than that simpler algorithm?
==========================================================

Regards,
Amit

  reply	other threads:[~2021-06-12  8:42 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 10:31 Wilco Dijkstra
2021-06-09 11:42 ` Amit Choudhary
2021-06-09 12:05   ` Phil Blundell
2021-06-09 12:11     ` Adhemerval Zanella
2021-06-09 12:22       ` Amit Choudhary
2021-06-09 12:55         ` Adhemerval Zanella
2021-06-09 13:18           ` Amit Choudhary
2021-06-09 13:32             ` Amit Choudhary
2021-06-09 13:40             ` Adhemerval Zanella
2021-06-09 14:08               ` Amit Choudhary
2021-06-09 14:25                 ` Phil Blundell
2021-06-09 12:18     ` Amit Choudhary
2021-06-09 13:48       ` Phil Blundell
2021-06-09 21:44   ` Wilco Dijkstra
2021-06-10  2:42     ` Amit Choudhary
2021-06-10  3:23       ` Dan Raymond
2021-06-10  4:19         ` Amit Choudhary
2021-06-10  9:44       ` Wilco Dijkstra
2021-06-10 11:08         ` Amit Choudhary
2021-06-10 16:53           ` Amit Choudhary
2021-06-10 20:04             ` Amit Choudhary
2021-06-11  8:28               ` Amit Choudhary
2021-06-11 11:45           ` Wilco Dijkstra
2021-06-11 12:42             ` Amit Choudhary
2021-06-11 13:39               ` Amit Choudhary
2021-06-11 13:46               ` Wilco Dijkstra
2021-06-11 15:52                 ` Amit Choudhary
2021-06-11 19:14                   ` Amit Choudhary
2021-06-11 19:26                     ` Paul Eggert
2021-06-11 19:41                       ` Amit Choudhary
2021-06-11 20:00                         ` Dan Raymond
2021-06-12  4:00                           ` Amit Choudhary
2021-06-12  4:18                             ` Amit Choudhary
2021-06-12  7:16                               ` [Final testing with benchmark tests] " Amit Choudhary
2021-06-12  8:01                                 ` Paul Zimmermann
2021-06-12  8:41                                   ` Amit Choudhary [this message]
2021-06-12 13:29                                     ` Amit Choudhary
2021-06-12 10:56                                   ` Siddhesh Poyarekar
2021-06-12 13:47                                     ` Amit Choudhary
2021-06-13  3:32                                       ` Siddhesh Poyarekar
2021-06-13  4:06                                         ` Amit Choudhary
2021-06-11 13:57               ` Paul Zimmermann
2021-06-11 14:04                 ` Amit Choudhary
2021-06-11 14:16                   ` Paul Zimmermann
2021-06-11 14:27                     ` Amit Choudhary

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFf+5zg24pQhLqLL0dC43dCEcYiSq4Lhp56oUhVb7EJvgQSYEw@mail.gmail.com \
    --to=amitchoudhary0523@gmail.com \
    --cc=Paul.Zimmermann@inria.fr \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).