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

Konstantin Varlamov via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 1 17:39:15 PDT 2024


var-const wrote:

> 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?

@xiaoyang-sde Can you please update your branch to make sure #73255 is included and rerun the benchmarks? This might give us some indication on whether this patch is worth pursuing further.

FWIW, I'm somewhat in favor of landing this. If numbers show that there is no performance difference anymore, we should probably remove similar optimizations from `ends_with` -- whether we delegate to `equal` or not, IMO it should be consistent between `starts_with` and `ends_with`. Also, I think adding a benchmark and extending `desugars_to` is valuable independent of changes to the algorithm itself.

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


More information about the libcxx-commits mailing list