[all-commits] [llvm/llvm-project] c567e2: [libc++] Optimize vector<bool>::reserve (#170137)

Nikolas Klauser via All-commits all-commits at lists.llvm.org
Wed Dec 10 01:19:21 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c567e28a9d1c8f184f9cfdc6f9e1c8a6bcb8d296
      https://github.com/llvm/llvm-project/commit/c567e28a9d1c8f184f9cfdc6f9e1c8a6bcb8d296
  Author: Nikolas Klauser <nikolasklauser at berlin.de>
  Date:   2025-12-10 (Wed, 10 Dec 2025)

  Changed paths:
    M libcxx/docs/ReleaseNotes/22.rst
    M libcxx/include/__vector/vector_bool.h
    M libcxx/test/benchmarks/containers/sequence/vector_bool.bench.cpp

  Log Message:
  -----------
  [libc++] Optimize vector<bool>::reserve (#170137)

Apple M4:
```
Benchmark                                                                      old        new    Difference    % Difference
--------------------------------------------------------------------------  ------  ----------  ------------  --------------
vector<bool>(const_vector<bool>&)                                            12.73       12.87          0.14           1.07%
vector<bool>(size_type,_const_value_type&)                                    9.39        9.41          0.02           0.22%
vector<bool>(vector<bool>&&,_const_allocator_type&)_(different_allocators)   16.87       15.22         -1.65          -9.80%
vector<bool>(vector<bool>&&,_const_allocator_type&)_(equal_allocators)        2.68        2.73          0.05           1.90%
vector<bool>::reserve()                                                      11.81        9.43         -2.38         -20.14%
Geomean                                                                       9.14        8.62         -0.53          -5.76%
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list