HEADS DOWN
Andrey Chernov
ache at freebsd.org
Sat May 5 22:11:39 UTC 2007
On Sat, May 05, 2007 at 04:48:44PM -0500, Sean C. Farley wrote:
> I have the same assembly output. Inlined __strleneq() ends up being
> faster on my system than GCC's strlen() when I changed all calls where
> checkEquals equaled false. I believe you that it should be faster with
> GCC's version, but it is not ending up that way on my Athlon XP and
> Pentium 4 systems running FreeBSD 6.2.
>
> There is now a sysenv-strlen.c that I tested the timings.c program in
> regressions/environment directory. It keeps showing __strleneq() to be
> faster.
I wonder how it possible. Your after "if" variant becomes
.L13:
incl %eax
cmpb $0, (%eax)
jne .L13
which should be slower in general than gcc ones.
Could you please run some test for just this two functions (without all
other stuff): strlen() (gcc -O) and inlined __strleneq() for some array of
different-size strings?
--
http://ache.pp.ru/
More information about the freebsd-arch
mailing list