[libcxx-commits] [libcxx] Optimize __assign_with_sentinel in std::vector (PR #113852)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 11 13:39:48 PST 2024


================
@@ -69,6 +69,10 @@ Improvements and New Features
 - The ``_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY`` ABI configuration was added, which allows storing valid bounds
   in ``std::array::iterator`` and detecting OOB accesses when the appropriate hardening mode is enabled.
 
+- The `assign(_InputIterator, _InputIterator)` function of `std::vector<_Tp, _Allocator>` has been optimized for
+  non-trivial element types, such as `std::vector<std::string>`, with a performance improvement of up to 2.3x. The
+  performance for trivial types, such as `std::vector<int>`, remains similar or shows slight improvements.
----------------
philnik777 wrote:

Can we call out that this is _only_ for input iterators? This makes it look like it's for any kind of iterator.

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


More information about the libcxx-commits mailing list