Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
substring match like "strstr"
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Sven LUTHER <luther@d...>
Subject: Re: substring match like "strstr"
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.


Sven Luther