Agner Fog wrote:
I have tested a few of the most important functions in
libc and compared them with other available libraries (MS, Borland,
Intel, Mac). The comparison does not look good for gnu libc. See my test
results in http://www.agner.org/optimize/optimizing_cpp.pdf section 2.6.
As far as I can see, you identify the library you tested only as "ubuntu
g++ 4.2.3." Presumably, that implies some version of glibc? On my x86-64
system where I have glibc-2.6.1-18.3, some of the functions perform much
better than those provided with earlier glibc versions.
Speaking of the one case where I have looked into it, the builtin_memcpy
of gcc for 32-bit linux uses a string move which performs well only for
certain cases of short non-aligned strings. The corresponding 64-bit
linux will see vastly different levels of performance, depending on the
glibc version, as it doesn't use a builtin string move.
Certain newer CPUs aim to improve performance of the 32-bit gcc builtin
string moves, but don't entirely eliminate the situations where it isn't
optimum.
The machinery for getting good performing versions in glibc isn't visible
on this list.