This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Simplify strncat.

On 17-12-2014 14:32, OndÅej BÃlka wrote:
> On Tue, Dec 16, 2014 at 12:36:38PM -0800, Roland McGrath wrote:
>> Use '\0', not '\000'.
>> IIRC we have a general policy about having a benchtests case and citing
>> numbers on that.
> That is not policy as benchtest results on string function are still
> meaningless. Here I could simply improve benchtest score by inlining
> strnlen and memcpy implementations, for example with
> #define memcpy memcpy2
> #include <string/memcpy.c>
> As it avoids call overhead. However it would be big mistake to do that
> "optimization" as strncat is cold function while memcpy is likely in
> memory it degrade performance due to additonal icache misses.
This is a fair criticize, but benchtests from string functions are far for
'meanigless'.  On powerpc side, for instance, I noted unaligned cases 
that current code for strcpy was outperforming.  It leads to check more
result using different workloads and profiler and code a better strategy.
Which resulted in a better implementation in the end (patch just posted).

Better would be to characterize a better string benchtest and provide

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]