[libcxx-commits] [libcxx] [libc++] Tiny optimizations for is_permutation (PR #129565)
Imad Aldij via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Mar 20 15:12:44 PDT 2025
imdj wrote:
So, I compared few of the benchmarks results in pairs and ranked the top 10 with largest relative changes. The results overall match your findings @ldionne :
```
------------------------------------------------------------------------------------------------------------------------
Benchmark | Bad CPU (ns) | Good CPU (ns) | Abs Diff | Change (%)
------------------------------------------------------------------------------------------------------------------------
rng::is_permutation(vector<int>) (4leg) (shuffled)/1024 711634.00 698098.00 13536.00 1.90
rng::is_permutation(vector<int>) (4leg, pred) (shuffled)/8 120.00 122.00 2.00 1.67
std::is_permutation(list<int>) (3leg, pred) (common prefix)/8192 41729.00 41151.00 578.00 1.39
rng::is_permutation(list<int>) (4leg, pred) (common prefix)/8192 41816.00 41271.00 545.00 1.30
std::is_permutation(list<int>) (4leg) (common prefix)/8192 41871.00 41359.00 512.00 1.22
rng::is_permutation(list<int>) (4leg) (common prefix)/8192 41802.00 41295.00 507.00 1.21
std::is_permutation(list<int>) (4leg, pred) (common prefix)/8192 41976.00 41490.00 486.00 1.16
std::is_permutation(list<int>) (4leg, pred) (common prefix)/1024 3841.00 3875.00 34.00 0.89
std::is_permutation(vector<int>) (4leg, pred) (shuffled)/8 120.00 121.00 1.00 0.83
std::is_permutation(vector<int>) (3leg) (shuffled)/8 98.80 98.10 0.70 0.71
```
https://github.com/llvm/llvm-project/pull/129565
More information about the libcxx-commits
mailing list