Assembly string functions in i386 libc
Sean C. Farley
scf at FreeBSD.org
Wed Jul 11 20:24:19 UTC 2007
While looking at increasing the speed of strlen(), I noticed that on
i386 platforms (PIII, P4 and Athlon XP) the performance is abysmal in
libc compared to the version I was writing. After more testing, I found
it was only the assembly version that is really slow. The C version is
fairly quick. Is there a need to continue to use the assembly versions
of string functions on i386? Does it mainly help slower systems such as
those with i386 or i486 CPU's?
I have the results from my P4 (Id = 0xf24 Stepping = 4) system and the
test program here[1]. strlen.tar.bz2 is the archive of it for anyone's
testing. In the strlen/results subdirectory, there are the results for
strings of increasing lengths.
I would appreciate it if anyone could see if strlen and strlen2 perform
any better on an amd64. Although the current C version of strlen() in
7-CURRENT is faster than mine for smaller values, they perform better
for larger strings.
I doubt people would want either of my versions in CURRENT just before
the freeze :), but it would be nice to use the C version we do have
instead of the assembly version. I cannot speak about the other string
functions as I have not tested them.
Sean
1. http://www.farley.org/freebsd/tmp/
--
scf at FreeBSD.org
More information about the freebsd-arch
mailing list