AVX2 Optimized `strlen`
Katrina.Haigh@proton.me
Katrina.Haigh@proton.me
Sat Aug 9 03:01:24 GMT 2025
Hi
I have added AVX2 support to the strlen function (see attached).
It yields 3-6 times performance on large and small strings compared to the non-vectorized version across various AVX2-supporting CPUs.
I also unrolled the loop to scan four words per iteration in the non-vectorized version, yielding a 20%-40% speedup with larger strings across various x64 and arm64 CPUs.
So firstly, how desirable are vectorization optimizations for string processing in glibc at the moment?
Secondly, if these optimizations are desirable should I make further attempts to git send-email the patches?
I've had no luck making it work with Proton Mail, so perhaps I could try Gmail instead...
Regards,
Katrina Haigh
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: strlen.c
URL: <https://sourceware.org/pipermail/libc-help/attachments/20250809/03cd7349/attachment.c>
More information about the Libc-help
mailing list