[libcxx-commits] [libcxx] [libc++] Speed up vector<bool> copy/move-ctors [1/3] (PR #120132)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 29 09:02:42 PST 2025


================
@@ -39,6 +39,16 @@ void BM_CopyConstruct(benchmark::State& st, Container) {
   }
 }
 
+template <class Container, class Allocator>
+void BM_CopyConstruct_Alloc(benchmark::State& st, Container, Allocator a) {
+  auto size = st.range(0);
+  Container c(size);
+  for (auto _ : st) {
+    Container v(c, a);
----------------
ldionne wrote:

```suggestion
    Container v(c, a); // we assume the destructor doesn't dominate the benchmark
```

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


More information about the libcxx-commits mailing list