This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] faster strlen implementation
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: libc-alpha at sourceware dot org
- Date: Sat, 14 Jul 2012 13:15:54 +0200
- Subject: Re: [PATCH] faster strlen implementation
- References: <20120707184529.GA31370@domone.rutgers.edu>
On Sat, Jul 07, 2012 at 08:45:29PM +0200, OndÅej BÃlka wrote:
> Here is optimized strlen sse2 implementation. It is about twice as fast
> on i7.
>
> Benchmarks are here:
> http://kam.mff.cuni.cz/~ondra/benchmark_string/i7/strlen/html/test_r.html
> http://kam.mff.cuni.cz/~ondra/benchmark_string/xeon/strlen/html/test_r.html
> http://kam.mff.cuni.cz/~ondra/benchmark_string/phenomII/strlen/html/test_r.html
> http://kam.mff.cuni.cz/~ondra/benchmark_string/opteron/strlen/html/test_r.html
It turned that I forgot to look if strlen implementation changed since
2.13 I tested with (strstr,chr.. did not).
A glibc pminub implementation is faster when string is in L1 cache, then
my prefetch makes it faster.