[libcxx-commits] [libcxx] Optimize __insert_with_sentinel Function in std::vector (PR #113768)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Nov 1 08:59:50 PDT 2024


================
@@ -1360,27 +1360,27 @@ vector<_Tp, _Allocator>::__insert_with_sentinel(const_iterator __position, _Inpu
   for (; this->__end_ != this->__end_cap() && __first != __last; ++__first) {
----------------
ldionne wrote:

(Not attached to this line)

Do we have a benchmark for this operation? What is the before/after comparison? If there's no benchmark, one should be added in `libcxx/test/benchmarks/vector_operations.bench.cpp` (probably via `libcxx/test/benchmarks/ContainerBenchmarks.h`). How to run benchmarks is documented at https://libcxx.llvm.org/TestingLibcxx.html#benchmarks (be careful, these instructions are going to be simplified in the near future but for now they're correct).

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


More information about the libcxx-commits mailing list