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 SAA18558 for caml-red; Thu, 14 Dec 2000 18:48:27 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA09662 for ; Tue, 12 Dec 2000 10:58:49 +0100 (MET) Received: from dpt-info.u-strasbg.fr (dpt-info.u-strasbg.fr [130.79.6.1]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id eBC9wmX29688 for ; Tue, 12 Dec 2000 10:58:48 +0100 (MET) Received: from lambda.u-strasbg.fr (lambda.u-strasbg.fr [130.79.90.63]) by dpt-info.u-strasbg.fr (8.9.3/8.9.3) with ESMTP id KAA11955; Tue, 12 Dec 2000 10:57:18 +0100 Received: from luther by lambda.u-strasbg.fr with local (Exim 3.20 #1 (Debian)) id 145mL9-0006gO-00; Tue, 12 Dec 2000 11:07:19 +0100 Date: Tue, 12 Dec 2000 11:07:19 +0100 To: Chris Hecker Cc: eijiro_sumii@anet.ne.jp, caml-list@inria.fr, gerd@gerd-stolpmann.de, sumii@venus.is.s.u-tokyo.ac.jp Subject: Re: substring match like "strstr" Message-ID: <20001212110719.B25607@lambda.u-strasbg.fr> References: <00120814135508.00625@ice> <20001208150443I.sumii@yl.is.s.u-tokyo.ac.jp> <00120814135508.00625@ice> <20001210221657W.sumii@yl.is.s.u-tokyo.ac.jp> <4.3.2.7.2.20001211103237.00c12100@shell16.ba.best.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <4.3.2.7.2.20001211103237.00c12100@shell16.ba.best.com>; from checker@d6.com on Mon, Dec 11, 2000 at 01:07:22PM -0800 From: Sven LUTHER Sender: weis@pauillac.inria.fr On Mon, Dec 11, 2000 at 01:07:22PM -0800, Chris Hecker wrote: > > >The results (execution time in seconds) were as follows. > > strstr 55.74 > > regexp 154.37 > > OCamlA 302.57 > > OCamlB 129.23 > > Any ideas why strstr blows the others away? What's the libc strstr look like? I just looked in the MSVC source and it's a braindead while loop (copied below), so it's not like it's doing a fancy Boyer-Moore or anything. This is exactly the kind of problem on which I'd expect caml to come within 10% of c. Is this kind of thing not one of the field which can take advantage of the vector units included in the processor, like mmx, altivec and the equivalent in alpha or sparc processors ? Not sure though, it would depend on the actual implementation used and command set. Friendly, Sven Luther