hiraditya added a comment. Just for the record, I ported the patch to gcc/libstdc++ as well: PR66414 optimize std::string::find https://github.com/gcc-mirror/gcc/commit/fc7ebc4b8d9ad7e2891b7f72152e8a2b7543cd65 Repository: rL LLVM https://reviews.llvm.org/D27068