> So, some parts of Linux kernel may be optimized...
for this case something like the followind diff solves the
problem nicely, at least for recent compilers (it may have
to be wrapped with gcc-version conditionals). [sorry for
no offsets, but i've extracted this from many other changes
to string.h; I will have to clean this up before making
the rest available]
The difference in speed for kernel vs gcc2.95 strlen can
be as bad as (timed for rather long strings - not the
best benchmark; on a celeron)
318011 574120 574118 57076 41560 : ffff strlen_builtin
1003034 1810793 1810791 179996 130600 : ffff strlen_kernel
diff -urNp --exclude-from /usr/src/lkdontdiff /img/linux-2.3.12p5/include/asm-i386/string.h linux-as/include/asm-i386/string.h
--- /img/linux-2.3.12p5/include/asm-i386/string.h Sat May 1 16:36:31 1999
+++ linux-as/include/asm-i386/string.h Mon Jul 26 10:52:25 1999
:"=c" (__res), "=&D" (d0) :"1" (s),"a" (0), "0" (0xffffffff));
return __res;
}
+#define strlen __builtin_strlen
extern inline void * __memcpy(void * to, const void * from, size_t n)
{
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/