[libcxx-commits] [libcxx] [libc++] Trim down associative container benchmark sizes (PR #212252)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jul 27 06:44:42 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Louis Dionne (ldionne)
<details>
<summary>Changes</summary>
Based on local measurements, the associative containers are by far the slowest benchmarks to run. While there is value in benchmarking small and large sizes, we can significantly cut down benchmark times by stripping down to only 2 sizes (from 4).
With this patch, the benchmarks go from 3124s to 1766s across the associative container benchmarks, which is -43% of their execution time, and corresponds to ~15% of the entire benchmark suite.
Towards #<!-- -->173032
---
Full diff: https://github.com/llvm/llvm-project/pull/212252.diff
1 Files Affected:
- (modified) libcxx/test/benchmarks/containers/associative/associative_container_benchmarks.h (+2-2)
``````````diff
diff --git a/libcxx/test/benchmarks/containers/associative/associative_container_benchmarks.h b/libcxx/test/benchmarks/containers/associative/associative_container_benchmarks.h
index a55f187d2ac80..af403553c657d 100644
--- a/libcxx/test/benchmarks/containers/associative/associative_container_benchmarks.h
+++ b/libcxx/test/benchmarks/containers/associative/associative_container_benchmarks.h
@@ -63,10 +63,10 @@ void associative_container_benchmarks(std::string container) {
auto get_key = [](Value const& v) { return adapt_operations<Container>::key_from_value(v); };
auto bench = [&](std::string operation, auto f) {
- benchmark::RegisterBenchmark(container + "::" + operation, f)->Arg(0)->Arg(32)->Arg(1024)->Arg(8192);
+ benchmark::RegisterBenchmark(container + "::" + operation, f)->Arg(32)->Arg(8192);
};
auto bench_non_empty = [&](std::string operation, auto f) {
- benchmark::RegisterBenchmark(container + "::" + operation, f)->Arg(32)->Arg(1024)->Arg(8192);
+ benchmark::RegisterBenchmark(container + "::" + operation, f)->Arg(32)->Arg(8192);
};
static constexpr bool is_multi_key_container =
``````````
</details>
https://github.com/llvm/llvm-project/pull/212252
More information about the libcxx-commits
mailing list