[libcxx-commits] [libcxx] [libc++][ranges] optimize the performance of `ranges::starts_with` (PR #84570)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 26 07:49:10 PDT 2024


https://github.com/ldionne commented:

> With #73255 I don't think there will be any significant performance improvement anymore, so I'm not sure whether we want to continue pursuing this. It could probably reduce the amount of generated code a bit, but I'm not sure it's worth the additional amount of complexity. @ldionne do you have any thoughts?

I am not sure I read the benchmarks right, but if I did it looks like we do have quite a bit of a performance benefit with this patch. It makes sense too, since we only need to use `memcmp` to compare the two ranges instead of finding *where* they actually differ, which is more complicated.

So IMO this makes sense.

https://github.com/llvm/llvm-project/pull/84570


More information about the libcxx-commits mailing list