From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA16569 for caml-red; Thu, 14 Dec 2000 19:30:15 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA26332 for ; Thu, 14 Dec 2000 09:03:46 +0100 (MET) Received: from dynabook ([133.11.12.224]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id eBE83iL02851 for ; Thu, 14 Dec 2000 09:03:45 +0100 (MET) Received: from dynabook ([127.0.0.1] helo=localhost ident=sumii) by dynabook with esmtp (Exim 3.12 #1 (Debian)) id 146TLZ-0000BC-00; Thu, 14 Dec 2000 17:02:37 +0900 To: checker@d6.com From: eijiro_sumii@anet.ne.jp Cc: caml-list@inria.fr, gerd@gerd-stolpmann.de, sumii@venus.is.s.u-tokyo.ac.jp Subject: Re: substring match like "strstr" In-Reply-To: <4.3.2.7.2.20001213223322.00cb3c90@shell16.ba.best.com> References: <4.3.2.7.2.20001211103237.00c12100@shell16.ba.best.com> <20001214123635H.sumii@yl.is.s.u-tokyo.ac.jp> <4.3.2.7.2.20001213223322.00cb3c90@shell16.ba.best.com> X-Mailer: Mew version 1.94.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20001214170237M.sumii@yl.is.s.u-tokyo.ac.jp> Date: Thu, 14 Dec 2000 17:02:37 +0900 X-Dispatcher: imput version 991025(IM133) Sender: weis@pauillac.inria.fr > Is that C the simple C one I posted, or the libc one on sparc? It's the one in libc on Solaris, so may be tuned by hand in assembly. > Your new strstr is actually slower on x86 than your first one, but I > haven't looked into why yet. That's interesting. I confirmed it myself on my x86 machine with my program: strstr_imp2 88.530 strstr_fun 124.210 strstr_fun2 127.120 glibc strstr 61.310 Seeing such strong machine dependency, it seems yet more reasonable to use the "default" strstr provided by the system (unless the _pattern_ is long enough, in which case KMP or BM might perform better), even though there is some overhead --- about 5% in my profiling on SPARC --- of interfacing a C function to OCaml. This is a natural (though boring) conclusion, I think. Eijiro