This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: BZ#14317: Optimze __xpg_strerror_r
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Andreas Jaeger <aj at suse dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Sun, 2 Dec 2012 16:23:58 -0500
- Subject: Re: BZ#14317: Optimze __xpg_strerror_r
- References: <50BA387B.50109@suse.com>
On Sat, Dec 1, 2012 at 12:03 PM, Andreas Jaeger <aj@suse.com> wrote:
> Going through the waiting bugs, I noticed this small patch.
>
> Bruno comments:
>> The implementation of __xpg_strerror_r spends time doing an strlen call,
>> and then potentially returning before the value is actually used.
>>
>> This can be optimized.
>
> And Carlos answered:
>> Bruno,
>>
>> Fold the copyright years together e.g. 1991-2012.
>>
>> If you haven't posted this to libc-alpha, please do and I'll ack.
>>
>> This looks like a straight forward and useful optimization.
>
> Unfortunately, this was never send to libc-alpha.
>
> Ok to put it in now?
> Andreas
>
> 2012-12-01 Bruno Haible <bruno@clisp.org>
>
> [BZ #14317]
> * string/xpg-strerror.c (__xpg_strerror_r): Optimize, call strlen
> only if needed.
I'd like to avoid changes that aren't trivial or bug fixes.
This looks like a straight forward optimization, but removing a call
to strlen changes the behaviour of the program, and therefore doesn't
count as trivial or a bug fix.
I'd rather see it marked milestone 2.18 and priority P1, and put in
when we reopen.
Does that make sense?
Cheers,
Carlos.