[PATCH] Performance improvement for log()

Ulrich Drepper drepper@redhat.com
Thu Apr 10 19:57:00 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steven Munroe wrote:
> This patch redefines ABS(x) as __builtin_fabs(x).

And to do this you copy the entire file?  This is insane.  Do what is
done elsewhere.  Write a wrapper which defines macros and then uses the
orginal code.  I know this means changes to some headers.  But code
duplication isn't acceptable.


> Also the call out to __isnan() in the posix wrapper code (w_log()) was
> showing up hot in the profiles. So I added --with-cpu=[power4|power6]
> implementations that effectively in-line the isnan() test within
> __log().

That seems to be a bad idea as well.  It's no ppc-specific problem.
Again, use macros to abstract out the actual code use so that other
archs can parametrize this code as well.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFH/k4F2ijCOnn/RHQRApoLAJ4uzst/VWPr0AzVWIm3cPw9x7hRhwCggQDu
KDVQS4ye62Eyfd5OOPAy6i8=
=T4Bh
-----END PGP SIGNATURE-----



More information about the Libc-alpha mailing list