[libcxx-commits] [libcxx] Optimize input iterator overload of `std::vector::assign(first, last)` (PR #113852)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 26 13:59:19 PST 2024


================
@@ -69,4 +69,17 @@ BENCHMARK(bm_grow<std::string>);
 BENCHMARK(bm_grow<std::unique_ptr<int>>);
 BENCHMARK(bm_grow<std::deque<int>>);
 
+BENCHMARK_CAPTURE(BM_AssignInputIterIter, vector_int, std::vector<int>{}, getRandomIntegerInputs<int>)
+    ->Args({TestNumInputs, TestNumInputs});
+
+BENCHMARK_CAPTURE(
+    BM_AssignInputIterIter<32>, vector_string, std::vector<std::string>{}, getRandomStringInputsWithLength)
+    ->Args({TestNumInputs, TestNumInputs});
+
+BENCHMARK_CAPTURE(BM_AssignInputIterIter<100>,
----------------
ldionne wrote:

I don't fully understand the benefit of benchmarking both `vector<vector<int>>` and `vector<string>`. Can you explain (or point me to prior discussion on this PR that explains it in case I missed it)?

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


More information about the libcxx-commits mailing list