[libcxx-commits] [libcxx] [libc++] Remove benchmarks for ranges algorithms that have a std equivalent (PR #176138)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 16 07:32:56 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Nikolas Klauser (philnik777)

<details>
<summary>Changes</summary>

We're currently running all the algorithms benchmarks for the `std` and `ranges` variants, even though almost all the algorithms share the same code. This makes running the benchmarks on a large set of commits very slow and costly. This reduced running the `algorithm/` subdirectory from ~4 hours to roughtly 2.5 hours.

Fixes #<!-- -->175973


---

Patch is 98.14 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/176138.diff


49 Files Affected:

- (modified) libcxx/test/benchmarks/algorithms/modifying/copy.bench.cpp (-7) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/copy_backward.bench.cpp (-7) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/copy_if.bench.cpp (-8) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/copy_n.bench.cpp (-7) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/fill.bench.cpp (-6) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/fill_n.bench.cpp (-6) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/generate.bench.cpp (-3) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/generate_n.bench.cpp (-3) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/move.bench.cpp (-7) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/move_backward.bench.cpp (-7) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/remove.bench.cpp (-18) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/remove_copy.bench.cpp (-18) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/replace.bench.cpp (-19) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/reverse.bench.cpp (-3) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/reverse_copy.bench.cpp (-3) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/rotate.bench.cpp (-27) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/rotate_copy.bench.cpp (-3) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/sample.bench.cpp (-3) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/shuffle.bench.cpp (-2) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/swap_ranges.bench.cpp (-3) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/transform.binary.bench.cpp (-3) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/transform.unary.bench.cpp (-3) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/unique.bench.cpp (-19) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/unique_copy.bench.cpp (-19) 
- (modified) libcxx/test/benchmarks/algorithms/nonmodifying/adjacent_find.bench.cpp (-13) 
- (modified) libcxx/test/benchmarks/algorithms/nonmodifying/any_all_none_of.bench.cpp (-18) 
- (modified) libcxx/test/benchmarks/algorithms/nonmodifying/count.bench.cpp (-15) 
- (modified) libcxx/test/benchmarks/algorithms/nonmodifying/equal.bench.cpp (-15) 
- (modified) libcxx/test/benchmarks/algorithms/nonmodifying/find.bench.cpp (-15) 
- (modified) libcxx/test/benchmarks/algorithms/nonmodifying/find_end.bench.cpp (-18) 
- (modified) libcxx/test/benchmarks/algorithms/nonmodifying/find_first_of.bench.cpp (-19) 
- (modified) libcxx/test/benchmarks/algorithms/nonmodifying/for_each.bench.cpp (+4-8) 
- (modified) libcxx/test/benchmarks/algorithms/nonmodifying/for_each_n.bench.cpp (-5) 
- (modified) libcxx/test/benchmarks/algorithms/nonmodifying/is_permutation.bench.cpp (-19) 
- (modified) libcxx/test/benchmarks/algorithms/nonmodifying/mismatch.bench.cpp (-13) 
- (modified) libcxx/test/benchmarks/algorithms/nonmodifying/search.bench.cpp (-31) 
- (modified) libcxx/test/benchmarks/algorithms/nonmodifying/search_n.bench.cpp (-19) 
- (modified) libcxx/test/benchmarks/algorithms/partitions/is_partitioned.bench.cpp (-11) 
- (modified) libcxx/test/benchmarks/algorithms/partitions/partition.bench.cpp (-10) 
- (modified) libcxx/test/benchmarks/algorithms/partitions/partition_copy.bench.cpp (-5) 
- (modified) libcxx/test/benchmarks/algorithms/partitions/partition_point.bench.cpp (-5) 
- (modified) libcxx/test/benchmarks/algorithms/partitions/stable_partition.bench.cpp (-15) 
- (modified) libcxx/test/benchmarks/algorithms/sorting/is_sorted.bench.cpp (-13) 
- (modified) libcxx/test/benchmarks/algorithms/sorting/is_sorted_until.bench.cpp (-13) 
- (modified) libcxx/test/benchmarks/algorithms/sorting/partial_sort.bench.cpp (-5) 
- (modified) libcxx/test/benchmarks/algorithms/sorting/partial_sort_copy.bench.cpp (-9) 
- (modified) libcxx/test/benchmarks/algorithms/sorting/sort.bench.cpp (-4) 
- (modified) libcxx/test/benchmarks/algorithms/sorting/stable_sort.bench.cpp (-10) 
- (modified) libcxx/test/benchmarks/iterators/distance.bench.cpp (-3) 


``````````diff
diff --git a/libcxx/test/benchmarks/algorithms/modifying/copy.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/copy.bench.cpp
index 3549d918478bd..9c690eac6419e 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/copy.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/copy.bench.cpp
@@ -45,9 +45,6 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::copy(vector<int>)", std_copy);
     bm.operator()<std::deque<int>>("std::copy(deque<int>)", std_copy);
     bm.operator()<std::list<int>>("std::copy(list<int>)", std_copy);
-    bm.operator()<std::vector<int>>("rng::copy(vector<int>)", std::ranges::copy);
-    bm.operator()<std::deque<int>>("rng::copy(deque<int>)", std::ranges::copy);
-    bm.operator()<std::list<int>>("rng::copy(list<int>)", std::ranges::copy);
   }
 
   // {std,ranges}::copy(vector<bool>)
@@ -70,10 +67,6 @@ int main(int argc, char** argv) {
     };
     bm.operator()<true>("std::copy(vector<bool>) (aligned)", std_copy);
     bm.operator()<false>("std::copy(vector<bool>) (unaligned)", std_copy);
-#if TEST_STD_VER >= 23 // vector<bool>::iterator is not an output_iterator before C++23
-    bm.operator()<true>("rng::copy(vector<bool>) (aligned)", std::ranges::copy);
-    bm.operator()<false>("rng::copy(vector<bool>) (unaligned)", std::ranges::copy);
-#endif
   }
 
   benchmark::Initialize(&argc, argv);
diff --git a/libcxx/test/benchmarks/algorithms/modifying/copy_backward.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/copy_backward.bench.cpp
index f97a7a84d5e0a..6a601f757a35a 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/copy_backward.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/copy_backward.bench.cpp
@@ -45,9 +45,6 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::copy_backward(vector<int>)", std_copy_backward);
     bm.operator()<std::deque<int>>("std::copy_backward(deque<int>)", std_copy_backward);
     bm.operator()<std::list<int>>("std::copy_backward(list<int>)", std_copy_backward);
-    bm.operator()<std::vector<int>>("rng::copy_backward(vector<int>)", std::ranges::copy_backward);
-    bm.operator()<std::deque<int>>("rng::copy_backward(deque<int>)", std::ranges::copy_backward);
-    bm.operator()<std::list<int>>("rng::copy_backward(list<int>)", std::ranges::copy_backward);
   }
 
   // {std,ranges}::copy_n(vector<bool>)
@@ -71,10 +68,6 @@ int main(int argc, char** argv) {
     };
     bm.operator()<true>("std::copy_backward(vector<bool>) (aligned)", std_copy_backward);
     bm.operator()<false>("std::copy_backward(vector<bool>) (unaligned)", std_copy_backward);
-#if TEST_STD_VER >= 23 // vector<bool>::iterator is not an output_iterator before C++23
-    bm.operator()<true>("rng::copy_backward(vector<bool>) (aligned)", std::ranges::copy_backward);
-    bm.operator()<false>("rng::copy_backward(vector<bool>) (unaligned)", std::ranges::copy_backward);
-#endif
   }
 
   benchmark::Initialize(&argc, argv);
diff --git a/libcxx/test/benchmarks/algorithms/modifying/copy_if.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/copy_if.bench.cpp
index 76c653fc7f941..a295c73b733df 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/copy_if.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/copy_if.bench.cpp
@@ -52,10 +52,6 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::copy_if(vector<int>) (every other)", std_copy_if);
     bm.operator()<std::deque<int>>("std::copy_if(deque<int>) (every other)", std_copy_if);
     bm.operator()<std::list<int>>("std::copy_if(list<int>) (every other)", std_copy_if);
-
-    bm.operator()<std::vector<int>>("rng::copy_if(vector<int>) (every other)", std::ranges::copy_if);
-    bm.operator()<std::deque<int>>("rng::copy_if(deque<int>) (every other)", std::ranges::copy_if);
-    bm.operator()<std::list<int>>("rng::copy_if(list<int>) (every other)", std::ranges::copy_if);
   }
 
   // Benchmark {std,ranges}::copy_if where we copy the full range.
@@ -85,10 +81,6 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::copy_if(vector<int>) (entire range)", std_copy_if);
     bm.operator()<std::deque<int>>("std::copy_if(deque<int>) (entire range)", std_copy_if);
     bm.operator()<std::list<int>>("std::copy_if(list<int>) (entire range)", std_copy_if);
-
-    bm.operator()<std::vector<int>>("rng::copy_if(vector<int>) (entire range)", std::ranges::copy_if);
-    bm.operator()<std::deque<int>>("rng::copy_if(deque<int>) (entire range)", std::ranges::copy_if);
-    bm.operator()<std::list<int>>("rng::copy_if(list<int>) (entire range)", std::ranges::copy_if);
   }
 
   benchmark::Initialize(&argc, argv);
diff --git a/libcxx/test/benchmarks/algorithms/modifying/copy_n.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/copy_n.bench.cpp
index 35d3c5c78df13..d30674cf2ff8c 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/copy_n.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/copy_n.bench.cpp
@@ -45,9 +45,6 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::copy_n(vector<int>)", std_copy_n);
     bm.operator()<std::deque<int>>("std::copy_n(deque<int>)", std_copy_n);
     bm.operator()<std::list<int>>("std::copy_n(list<int>)", std_copy_n);
-    bm.operator()<std::vector<int>>("rng::copy_n(vector<int>)", std::ranges::copy_n);
-    bm.operator()<std::deque<int>>("rng::copy_n(deque<int>)", std::ranges::copy_n);
-    bm.operator()<std::list<int>>("rng::copy_n(list<int>)", std::ranges::copy_n);
   }
 
   // {std,ranges}::copy_n(vector<bool>)
@@ -69,10 +66,6 @@ int main(int argc, char** argv) {
     };
     bm.operator()<true>("std::copy_n(vector<bool>) (aligned)", std_copy_n);
     bm.operator()<false>("std::copy_n(vector<bool>) (unaligned)", std_copy_n);
-#if TEST_STD_VER >= 23 // vector<bool>::iterator is not an output_iterator before C++23
-    bm.operator()<true>("rng::copy_n(vector<bool>) (aligned)", std::ranges::copy_n);
-    bm.operator()<false>("rng::copy_n(vector<bool>) (unaligned)", std::ranges::copy_n);
-#endif
   }
 
   benchmark::Initialize(&argc, argv);
diff --git a/libcxx/test/benchmarks/algorithms/modifying/fill.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/fill.bench.cpp
index 9060752259eb9..4789eee552ced 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/fill.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/fill.bench.cpp
@@ -49,9 +49,6 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::fill(vector<int>)", std_fill);
     bm.operator()<std::deque<int>>("std::fill(deque<int>)", std_fill);
     bm.operator()<std::list<int>>("std::fill(list<int>)", std_fill);
-    bm.operator()<std::vector<int>>("rng::fill(vector<int>)", std::ranges::fill);
-    bm.operator()<std::deque<int>>("rng::fill(deque<int>)", std::ranges::fill);
-    bm.operator()<std::list<int>>("rng::fill(list<int>)", std::ranges::fill);
   }
 
   // {std,ranges}::fill(vector<bool>)
@@ -71,9 +68,6 @@ int main(int argc, char** argv) {
       })->Range(64, 1 << 20);
     };
     bm("std::fill(vector<bool>)", std_fill);
-#if TEST_STD_VER >= 23 // vector<bool>::iterator is not an output_iterator before C++23
-    bm("rng::fill(vector<bool>)", std::ranges::fill);
-#endif
   }
 
   benchmark::Initialize(&argc, argv);
diff --git a/libcxx/test/benchmarks/algorithms/modifying/fill_n.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/fill_n.bench.cpp
index 8ad3e7534b1ef..fc7895edddb98 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/fill_n.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/fill_n.bench.cpp
@@ -49,9 +49,6 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::fill_n(vector<int>)", std_fill_n);
     bm.operator()<std::deque<int>>("std::fill_n(deque<int>)", std_fill_n);
     bm.operator()<std::list<int>>("std::fill_n(list<int>)", std_fill_n);
-    bm.operator()<std::vector<int>>("rng::fill_n(vector<int>)", std::ranges::fill_n);
-    bm.operator()<std::deque<int>>("rng::fill_n(deque<int>)", std::ranges::fill_n);
-    bm.operator()<std::list<int>>("rng::fill_n(list<int>)", std::ranges::fill_n);
   }
 
   // {std,ranges}::fill_n(vector<bool>)
@@ -71,9 +68,6 @@ int main(int argc, char** argv) {
       })->Range(64, 1 << 20);
     };
     bm("std::fill_n(vector<bool>)", std_fill_n);
-#if TEST_STD_VER >= 23 // vector<bool>::iterator is not an output_iterator before C++23
-    bm("rng::fill_n(vector<bool>)", std::ranges::fill_n);
-#endif
   }
 
   benchmark::Initialize(&argc, argv);
diff --git a/libcxx/test/benchmarks/algorithms/modifying/generate.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/generate.bench.cpp
index 34354e5af0efb..f5f1be24c39a5 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/generate.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/generate.bench.cpp
@@ -50,9 +50,6 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::generate(vector<int>)", std_generate);
     bm.operator()<std::deque<int>>("std::generate(deque<int>)", std_generate);
     bm.operator()<std::list<int>>("std::generate(list<int>)", std_generate);
-    bm.operator()<std::vector<int>>("rng::generate(vector<int>)", std::ranges::generate);
-    bm.operator()<std::deque<int>>("rng::generate(deque<int>)", std::ranges::generate);
-    bm.operator()<std::list<int>>("rng::generate(list<int>)", std::ranges::generate);
   }
 
   benchmark::Initialize(&argc, argv);
diff --git a/libcxx/test/benchmarks/algorithms/modifying/generate_n.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/generate_n.bench.cpp
index 9f8fb1e07524d..196cd0dff2bed 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/generate_n.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/generate_n.bench.cpp
@@ -50,9 +50,6 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::generate_n(vector<int>)", std_generate_n);
     bm.operator()<std::deque<int>>("std::generate_n(deque<int>)", std_generate_n);
     bm.operator()<std::list<int>>("std::generate_n(list<int>)", std_generate_n);
-    bm.operator()<std::vector<int>>("rng::generate_n(vector<int>)", std::ranges::generate_n);
-    bm.operator()<std::deque<int>>("rng::generate_n(deque<int>)", std::ranges::generate_n);
-    bm.operator()<std::list<int>>("rng::generate_n(list<int>)", std::ranges::generate_n);
   }
 
   benchmark::Initialize(&argc, argv);
diff --git a/libcxx/test/benchmarks/algorithms/modifying/move.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/move.bench.cpp
index 7473dffc123ce..afef3609b0fc5 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/move.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/move.bench.cpp
@@ -47,9 +47,6 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::move(vector<int>)", std_move);
     bm.operator()<std::deque<int>>("std::move(deque<int>)", std_move);
     bm.operator()<std::list<int>>("std::move(list<int>)", std_move);
-    bm.operator()<std::vector<int>>("rng::move(vector<int>)", std::ranges::move);
-    bm.operator()<std::deque<int>>("rng::move(deque<int>)", std::ranges::move);
-    bm.operator()<std::list<int>>("rng::move(list<int>)", std::ranges::move);
   }
 
   // {std,ranges}::move(vector<bool>)
@@ -74,10 +71,6 @@ int main(int argc, char** argv) {
     };
     bm.operator()<true>("std::move(vector<bool>) (aligned)", std_move);
     bm.operator()<false>("std::move(vector<bool>) (unaligned)", std_move);
-#if TEST_STD_VER >= 23 // vector<bool>::iterator is not an output_iterator before C++23
-    bm.operator()<true>("rng::move(vector<bool>) (aligned)", std::ranges::move);
-    bm.operator()<false>("rng::move(vector<bool>) (unaligned)", std::ranges::move);
-#endif
   }
 
   benchmark::Initialize(&argc, argv);
diff --git a/libcxx/test/benchmarks/algorithms/modifying/move_backward.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/move_backward.bench.cpp
index 1cdc880910686..b7677c7e42a78 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/move_backward.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/move_backward.bench.cpp
@@ -47,9 +47,6 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::move_backward(vector<int>)", std_move_backward);
     bm.operator()<std::deque<int>>("std::move_backward(deque<int>)", std_move_backward);
     bm.operator()<std::list<int>>("std::move_backward(list<int>)", std_move_backward);
-    bm.operator()<std::vector<int>>("rng::move_backward(vector<int>)", std::ranges::move_backward);
-    bm.operator()<std::deque<int>>("rng::move_backward(deque<int>)", std::ranges::move_backward);
-    bm.operator()<std::list<int>>("rng::move_backward(list<int>)", std::ranges::move_backward);
   }
 
   // {std,ranges}::move_backward(vector<bool>)
@@ -74,10 +71,6 @@ int main(int argc, char** argv) {
     };
     bm.operator()<true>("std::move_backward(vector<bool>) (aligned)", std_move_backward);
     bm.operator()<false>("std::move_backward(vector<bool>) (unaligned)", std_move_backward);
-#if TEST_STD_VER >= 23 // vector<bool>::iterator is not an output_iterator before C++23
-    bm.operator()<true>("rng::move_backward(vector<bool>) (aligned)", std::ranges::move_backward);
-    bm.operator()<false>("rng::move_backward(vector<bool>) (unaligned)", std::ranges::move_backward);
-#endif
   }
 
   benchmark::Initialize(&argc, argv);
diff --git a/libcxx/test/benchmarks/algorithms/modifying/remove.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/remove.bench.cpp
index 19cd49641e173..cf5346113264e 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/remove.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/remove.bench.cpp
@@ -27,12 +27,6 @@ int main(int argc, char** argv) {
       return element == value;
     });
   };
-  auto ranges_remove_if = [](auto first, auto last, auto const& value) {
-    return std::ranges::remove_if(first, last, [&](auto element) {
-      benchmark::DoNotOptimize(element);
-      return element == value;
-    });
-  };
 
   // Benchmark {std,ranges}::{remove,remove_if} on a sequence of the form xxxxxxxxxxyyyyyyyyyy
   // where we remove the prefix of x's from the sequence.
@@ -83,17 +77,11 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::remove(vector<int>) (prefix)", std_remove);
     bm.operator()<std::deque<int>>("std::remove(deque<int>) (prefix)", std_remove);
     bm.operator()<std::list<int>>("std::remove(list<int>) (prefix)", std_remove);
-    bm.operator()<std::vector<int>>("rng::remove(vector<int>) (prefix)", std::ranges::remove);
-    bm.operator()<std::deque<int>>("rng::remove(deque<int>) (prefix)", std::ranges::remove);
-    bm.operator()<std::list<int>>("rng::remove(list<int>) (prefix)", std::ranges::remove);
 
     // {std,ranges}::remove_if
     bm.operator()<std::vector<int>>("std::remove_if(vector<int>) (prefix)", std_remove_if);
     bm.operator()<std::deque<int>>("std::remove_if(deque<int>) (prefix)", std_remove_if);
     bm.operator()<std::list<int>>("std::remove_if(list<int>) (prefix)", std_remove_if);
-    bm.operator()<std::vector<int>>("rng::remove_if(vector<int>) (prefix)", ranges_remove_if);
-    bm.operator()<std::deque<int>>("rng::remove_if(deque<int>) (prefix)", ranges_remove_if);
-    bm.operator()<std::list<int>>("rng::remove_if(list<int>) (prefix)", ranges_remove_if);
   }
 
   // Benchmark {std,ranges}::remove on a sequence of the form xyxyxyxyxyxyxyxyxyxy
@@ -147,17 +135,11 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::remove(vector<int>) (sprinkled)", std_remove);
     bm.operator()<std::deque<int>>("std::remove(deque<int>) (sprinkled)", std_remove);
     bm.operator()<std::list<int>>("std::remove(list<int>) (sprinkled)", std_remove);
-    bm.operator()<std::vector<int>>("rng::remove(vector<int>) (sprinkled)", std::ranges::remove);
-    bm.operator()<std::deque<int>>("rng::remove(deque<int>) (sprinkled)", std::ranges::remove);
-    bm.operator()<std::list<int>>("rng::remove(list<int>) (sprinkled)", std::ranges::remove);
 
     // {std,ranges}::remove_if
     bm.operator()<std::vector<int>>("std::remove_if(vector<int>) (sprinkled)", std_remove_if);
     bm.operator()<std::deque<int>>("std::remove_if(deque<int>) (sprinkled)", std_remove_if);
     bm.operator()<std::list<int>>("std::remove_if(list<int>) (sprinkled)", std_remove_if);
-    bm.operator()<std::vector<int>>("rng::remove_if(vector<int>) (sprinkled)", ranges_remove_if);
-    bm.operator()<std::deque<int>>("rng::remove_if(deque<int>) (sprinkled)", ranges_remove_if);
-    bm.operator()<std::list<int>>("rng::remove_if(list<int>) (sprinkled)", ranges_remove_if);
   }
 
   benchmark::Initialize(&argc, argv);
diff --git a/libcxx/test/benchmarks/algorithms/modifying/remove_copy.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/remove_copy.bench.cpp
index 582175b8a32cc..4afc657822ccf 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/remove_copy.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/remove_copy.bench.cpp
@@ -29,12 +29,6 @@ int main(int argc, char** argv) {
       return element == value;
     });
   };
-  auto ranges_remove_copy_if = [](auto first, auto last, auto out, auto const& value) {
-    return std::ranges::remove_copy_if(first, last, out, [&](auto element) {
-      benchmark::DoNotOptimize(element);
-      return element == value;
-    });
-  };
 
   // Benchmark {std,ranges}::{remove_copy,remove_copy_if} on a sequence of the form xxxxxxxxxxyyyyyyyyyy
   // where we remove the prefix of x's from the sequence.
@@ -70,17 +64,11 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::remove_copy(vector<int>) (prefix)", std_remove_copy);
     bm.operator()<std::deque<int>>("std::remove_copy(deque<int>) (prefix)", std_remove_copy);
     bm.operator()<std::list<int>>("std::remove_copy(list<int>) (prefix)", std_remove_copy);
-    bm.operator()<std::vector<int>>("rng::remove_copy(vector<int>) (prefix)", std::ranges::remove_copy);
-    bm.operator()<std::deque<int>>("rng::remove_copy(deque<int>) (prefix)", std::ranges::remove_copy);
-    bm.operator()<std::list<int>>("rng::remove_copy(list<int>) (prefix)", std::ranges::remove_copy);
 
     // {std,ranges}::remove_copy_if
     bm.operator()<std::vector<int>>("std::remove_copy_if(vector<int>) (prefix)", std_remove_copy_if);
     bm.operator()<std::deque<int>>("std::remove_copy_if(deque<int>) (prefix)", std_remove_copy_if);
     bm.operator()<std::list<int>>("std::remove_copy_if(list<int>) (prefix)", std_remove_copy_if);
-    bm.operator()<std::vector<int>>("rng::remove_copy_if(vector<int>) (prefix)", ranges_remove_copy_if);
-    bm.operator()<std::deque<int>>("rng::remove_copy_if(deque<int>) (prefix)", ranges_remove_copy_if);
-    bm.operator()<std::list<int>>("rng::remove_copy_if(list<int>) (prefix)", ranges_remove_copy_if);
   }
 
   // Benchmark {std,ranges}::{remove_copy,remove_copy_if} on a sequence of the form xyxyxyxyxyxyxyxyxyxy
@@ -118,17 +106,11 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::remove_copy(vector<int>) (sprinkled)", std_remove_copy);
     bm.operator()<std::deque<int>>("std::remove_copy(deque<int>) (sprinkled)", std_remove_copy);
     bm.operator()<std::list<int>>("std::remove_copy(list<int>) (sprinkled)", std_remove_copy);
-    bm.operator()<std::vector<int>>("rng::remove_copy(vector<int>) (sprinkled)", std::ranges::remove_copy);
-    bm.operator()<std::deque<int>>("rng::remove_copy(deque<int>) (sprinkled)", std::ranges::remove_copy);
-    bm.operator()<std::list<int>>("rng::remove_copy(list<int>) (sprinkled)", std::ranges::remove_copy);
 
     // {std,ranges}::remove_copy_if
     bm.operator()<std::vector<int>>("std::remove_copy_if(vector<int>) (sprinkled)", std_remove_copy_if);
     bm.operator()<std::deque<int>>("std::remove_copy_if(deque<int>) (sprinkled)", std_remove_copy_if);
     bm.operator()<std::list<int>>("std::remove_copy_if(list<int>) (sprinkled)", std_remove_copy_if);
-    bm.operator()<std::vector<int>>("rng::remove_copy_if(vector<int>) (sprinkled)", ranges_remove_copy_if);
-    bm.operator()<std::deque<int>>("rng::remove_copy_if(deque<int>) (sprinkled)", ranges_remove_copy_if);
-    bm.operator()<std::list<int>>("rng::remove_copy_if(list<int>) (sprinkled)", ranges_remove_copy_if);
   }
 
   benchmark::Initialize(&argc, argv);
diff --git a/libcxx/test/benchmarks/algorithms...
[truncated]

``````````

</details>


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


More information about the libcxx-commits mailing list