This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Optimize strstr, strcasestr and memmem
On Mon, May 21, 2012 at 2:33 PM, Maxim Kuvyrkov <maxim@codesourcery.com> wrote:
>> The biggest problem I have with reviewing *any* of this code is that
>> performance is relative to benchmarks.
>
> While the other portion of this thread is being hijacked by discussion of GLIBC benchmarking, let's return to the patch that started this thread.
It was hijacking with a purpose.
> This patch is an algorithmic improvement, which makes strstr and company do less work by piggy backing the task of detecting EOL with the matching procedure. ?As is, EOL is detected by a dedicated call to memchr, which is extremely expensive.
>
> The only non-algorithmic improvement in the patch is the conversion of array[index] addressing to pointers. ?Replacing two variables and, potentially, an add instruction ("array", "index" and "array+index") with one variable ("pointer_array") is a fairly uncontroversial micro-optimization.
>
> Any reason for the review to not proceed?
No reason.
Cheers,
Carlos.