This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] powerpc: strstr optimization
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>, Rajalakshmi Srinivasaraghavan <raji at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org, sjmunroe at us dot ibm dot com
- Date: Thu, 21 May 2015 11:08:18 -0400
- Subject: Re: [PATCH] powerpc: strstr optimization
- Authentication-results: sourceware.org; auth=none
- References: <1429254584-124997-1-git-send-email-raji at linux dot vnet dot ibm dot com> <20150501120510 dot GB2203 at domone> <554704A1 dot 3010007 at linux dot vnet dot ibm dot com> <20150505211414 dot GA18085 at domone> <554A1703 dot 5090707 at linux dot vnet dot ibm dot com> <20150512084906 dot GA25772 at domone>
On 05/12/2015 04:49 AM, OndÅej BÃlka wrote:
>>> Following function should beat it.
>>>
>>> char *strstr (char *s, char *n)
>>> {
>>> if (n[0] == 0)
>>> return s;
>>> while (s = strchr (s, n[0]))
>>> {
>>> long i;
>>> for (i=1; n[i] && n[i] == s[i]; i++);
>>> if (n[i] == 0)
>>> return s;
>>> s++;
>>> }
>>> }
>> Calling strchr in a loop is not showing improvement when compared
>> to the proposed patch.
>>>
> Evidence?
>
I agree with Ondrej here. What tests are you doing to show there is
no performance improvement? Can we see those tests? Can you contribute
them to the microbenchmark so other Power vendors can use them against
their particular hardware to validate performance?
Cheers,
Carlos.