[libcxx-commits] [libcxx] [libc++] Tiny optimizations for is_permutation (PR #129565)

Imad Aldij via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 24 20:01:05 PDT 2025


imdj wrote:

> Indeed, this is the speedup I get when I drop `std::ref` from the `mismatch` call and ensure that we vectorize on AppleClang:
> 
> ```
> Benchmark                                                                      Time             CPU      Time Old      Time New       CPU Old       CPU New
> -----------------------------------------------------------------------------------------------------------------------------------------------------------
> std::is_permutation(vector<int>) (3leg) (common prefix)/8                   -0.4075         -0.4075             4             2             4             2
> std::is_permutation(vector<int>) (3leg) (common prefix)/1024                -0.8155         -0.8154           548           101           547           101
> std::is_permutation(vector<int>) (3leg) (common prefix)/8192                -0.7890         -0.7887          3925           828          3918           828
> OVERALL_GEOMEAN                                                             -0.9526         -0.9526             0             0             0             0
> ```

Could the diff in results be originating from using a different commit as base for old benchmarks? I'm using 9b1f905 as base

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


More information about the libcxx-commits mailing list