3 ms·
BSD implementation of strlen() is handwritten in assembler for most architectures, and is optimized. The misunderstanding about it not being optimized is probab
by dchest 17y ago
BSD implementation of strlen() is handwritten in assembler for most architectures, and is optimized. The misunderstanding about it not being optimized is probably because someone read the fall-back non-optimized C implementation and missed architecture-specific directories.
This was discussed in this thread: http://news.ycombinator.com/item?id=510832 http://news.ycombinator.com/item?id=510832
Edit: glibc also doesn't use the generic optimized version in C on some architectures, see for example: http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/strlen.c?rev=1.8&content-type=text/x-cvsweb-markup&cvsroot=glibc http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/i3...