[PATCH] Improve strstr performance

Wilco Dijkstra Wilco.Dijkstra@arm.com
Tue Jul 17 12:54:00 GMT 2018


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



More information about the Libc-alpha mailing list