Version française
Home     About     Download     Resources     Contact us    
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: eijiro_sumii@a...
Subject: Re: substring match like "strstr"
> 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