[GLIBC][PATCH v2] Remove strdup inlines
Florian Weimer
fweimer@redhat.com
Mon Dec 12 15:43:00 GMT 2016
On 12/12/2016 04:39 PM, Wilco Dijkstra wrote:
>> I don't think it's true that strdup is mostly used for error reporting.
>> Why do you think so?
>
> Because strdup is not used in the hot loop of any application. strdup uses in
> GLIBC are related to error reporting and environment processing which is not
> performance critical. Like strdupa and explicit use of unaligned accesses, all
> this is premature micro optimization. Removing unnecessary string copies
> (why is strdup of a constant string a useful idiom that should be optimized?)
> or speeding up malloc would be more worthwhile.
Agreed. Thanks for the explanation.
Florian
More information about the Libc-alpha
mailing list