[PATCH] powerpc: Optimized st{r,p}ncpy for POWER8/PPC64
Ondřej Bílka
neleai@seznam.cz
Tue Jan 6 18:53:00 GMT 2015
On Thu, Jan 01, 2015 at 05:14:52PM -0200, Adhemerval Zanella wrote:
> This patch adds an optimized POWER8 st{r,p}ncpy using unaligned accesses.
> It shows 10%-80% improvement over the optimized POWER7 one that uses
> only aligned accesses, specially on unaligned inputs.
>
This could hurt overall performance as strncpy/stpncpy are rarely used
and should be avoided where performance is concern. Optimizing for cache
usage would be better, I would not be surprised that runtime cost was
dominated by time these functions are read from disk/get into cache.
Also I would compare this with generic strnlen+memcpy to call power8
versions when possible.
Main question is why there is no power8 memcpy using unaligned loads yet?
Memcpy is called about hundred times more often than strcpy(and no
strncpy call) on my computer so possible gains are bigger and with
optimized memcpy a generic strncpy will be faster as well.
More information about the Libc-alpha
mailing list