https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81657
--- Comment #13 from H.J. Lu <hjl.tools at gmail dot com> --- (In reply to Wilco from comment #12) > > > > Do you have data to show that? > > Yes, on x64 I get these timings for a simple function containing just the > library call: > > size 1024 - 13845 21025 14449 (rawmemchr/memchr/strlen) On Skylake/x86-64, I got strlen: Length 1024, alignment 0: 178.781 Length 1024, alignment 7: 162.625 Length 1024, alignment 10: 161.969 strchr: Length 1024, alignment in bytes 0: 83.7812 Length 1024, alignment in bytes 6: 82.0938 strchr is 2X faster. It uses a very different algorithm. I will check if I can fold strlen into strchr.