[PATCH] Faster strlen
Andi Kleen
andi@firstfloor.org
Tue Oct 9 13:51:00 GMT 2012
Ondřej Bílka <neleai@seznam.cz> writes:
>
> I also benchmarked atom and added variant which is identical to
> strlen-sse2-pminub except bsf is replaced by table lookup.
Is your micro benchmark just a tight loop or does it fill the caches?
I have doubts that table lookups are a good idea if it blows away
the working set in L1 for the application.
Microbenchmarks that do not use caches much can be very misleading
here. Even if it's slightly slower not doing table lookups
is usually preferred for functions like this, simply because it lessens
the impact on the caches.
I would recommend to measure what happens both if the microbenchmark
stresses data cache and icache. Otherwise you risk winning
benchmarks, but making real apps slower.
-Andi
--
ak@linux.intel.com -- Speaking for myself only
More information about the Libc-alpha
mailing list