This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Improve strstr performance
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, nd <nd at arm dot com>
- Date: Tue, 17 Jul 2018 12:54:42 +0000
- Subject: Re: [PATCH] Improve strstr performance
- References: <HE1PR08MB1035D0511911AA9629E478BE834E0@HE1PR08MB1035.eurprd08.prod.outlook.com>,<b08d4b66-7afb-4e95-3e77-baeb0157c7bb@linaro.org>
Adhemerval Zanella wrote:
>> Overall the synced version makes the code far more readable, so it is a good idea
>> as a basis for further improvements. However it will only be faster with my patch
>> fully merged.
>
> My intention was to check if it would be worth to sync gnulib and then
> apply your change on top or the other way around. It seems it would be
> better to add your patch and I will propose another with some gnulib
> changes (mainly documentation and small optimizations). Some glibc
> differences seems more to get around some compiler missed optimization
> than actually code improvements (99677e575504 for instance).
I've committed my strstr patch now. If I had known about the gnulib version,
I would have started from that! It looks it can be simplified further - due to
strchr/memchr/strnlen using a single pointer everywhere would be best.
I don't think there is any point working around missed compiler optimizations -
it seems better to fix GCC if the issue still exists.
Wilco