3 ms·
Apple's libc is probably SIMD-optimized. You can make strlen a ton faster with some basic SSE instructions.
by DarkShikari 18y ago
Apple's libc is probably SIMD-optimized. You can make strlen a ton faster with some basic SSE instructions.
- jwilliams 18y ago... Yep - And OpenBSD is intended to run on as much hardware as possible - hence this simpler form might suit their purposes.
- dchest 18y agoNope, the have implementations for different architectures, you can find them here: http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/arch/ http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/arch/ The linked code is for the case when there's no arch-specific implementation.
- jwilliams 18y agoThanks - sort of what I meant though :)
- dchest 18y agoHere's the source code for Apple's implementation (i386): http://www.opensource.apple.com/darwinsource/10.5.5/Libc-498.1.1/i386/string/strlen.s http://www.opensource.apple.com/darwinsource/10.5.5/Libc-498... (requires registration, here's gist link: http://gist.github.com/77178 http://gist.github.com/77178)