From: eijiro_sumii@anet.ne.jp
To: caml-list@inria.fr
Cc: Jean-Christophe.Filliatre@lri.fr, proff@iq.org,
jmp@arsdigita.com, sumii@venus.is.s.u-tokyo.ac.jp
Subject: Re: substring match like "strstr"
Date: Wed, 13 Dec 2000 19:02:07 +0900 [thread overview]
Message-ID: <20001213190207A.sumii@yl.is.s.u-tokyo.ac.jp> (raw)
In-Reply-To: <14902.6640.301542.507040@pc803>
Hi everyone,
Thank you very much for a lot of kind advice!
Jean-Christophe Filliatre <Jean-Christophe.Filliatre@lri.fr> wrote:
> I missed the beginning of the discussion, but implementing
> Knuth-Morris-Pratt is quite easy. The code is given below (26 lines),
Actually, I found the (almost) same code on the web and tried it. The
results (again, execution time in seconds) were:
SPARC Pentium
strstr 52.68 57.050
kmp 111.52 143.490
The SPARC machine is the same as before. The Pentium machine is
running Linux 2.2.17 inside VMWare 2.0.3 (with 48MB virtual main
memory) on Windows 2000 with a Pentium II 400MHz processor and 128MB
main memory.
Since my program calls the function more than 3000 times for _each_
pattern, I did partial application, of course. Even so, kmp in OCaml
still performed much worse than strstr in libc (both Sun's and GNU's),
at least in this program.
If you'd like to check it yourself, the source code is available at
the same URL as before
(http://www.yl.is.s.u-tokyo.ac.jp/~sumii/tmp/hc.tar.gz).
Julian Assange <proff@iq.org> wrote:
> I'm interested in this library. Can you tell me a little more? What's
> your ETA?
It is explained a little at:
http://www.hypothesiscreator.net/
It has been developed in C++, but we began to port it to OCaml for
clarity and convenience (and fun:-).
Julian Assange <proff@iq.org> wrote:
> If you are really calling strstr 400,000,000 times, I strongly suggest
> the use of Boyer-Moore. Is your alphabet amino-acids or base-pairs? If
Can Boyer-Moore (in OCaml) be _much_ faster than KMP, so that it beats
strstr in libc?
John Prevost <jmp@arsdigita.com> wrote:
> I just grabbed the glibc version, and found the following comment at
> the head of it:
That was exactly what I found too (and mentioned a bit in my previous
message). Maybe I should also disassemble and check Sun's strstr...?
Regards,
Eijiro
next prev parent reply other threads:[~2000-12-14 18:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-08 6:04 eijiro_sumii
2000-12-08 12:57 ` Gerd Stolpmann
2000-12-10 13:16 ` eijiro_sumii
2000-12-10 15:39 ` Gerd Stolpmann
2000-12-11 3:57 ` eijiro_sumii
2000-12-12 13:58 ` Julian Assange
2000-12-11 21:07 ` Chris Hecker
2000-12-11 22:22 ` Gerd Stolpmann
2000-12-12 5:06 ` Chris Hecker
2000-12-12 12:28 ` Jean-Christophe Filliatre
2000-12-13 10:02 ` eijiro_sumii [this message]
2000-12-13 10:17 ` Eijiro Sumii
2000-12-13 10:53 ` Julian Assange
2000-12-13 13:28 ` Eijiro Sumii
2000-12-12 3:28 ` eijiro_sumii
2000-12-13 1:12 ` John Prevost
2000-12-13 2:35 ` Chris Hecker
2000-12-12 10:07 ` Sven LUTHER
2000-12-14 3:36 ` eijiro_sumii
2000-12-14 6:48 ` Chris Hecker
2000-12-14 8:02 ` eijiro_sumii
2000-12-14 21:53 ` Stephan Tolksdorf
2000-12-14 21:12 Ruchira Datta
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=20001213190207A.sumii@yl.is.s.u-tokyo.ac.jp \
--to=eijiro_sumii@anet.ne.jp \
--cc=Jean-Christophe.Filliatre@lri.fr \
--cc=caml-list@inria.fr \
--cc=jmp@arsdigita.com \
--cc=proff@iq.org \
--cc=sumii@venus.is.s.u-tokyo.ac.jp \
/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 NNTP newsgroup(s).