[Bug libstdc++/124463] [15/16 Regression] Big (10x) performance regression for std::deque<unsigned char>
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 12 18:34:22 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124463
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
In GCC 14 std::uninitialized_copy would dispatch to std::copy, which has custom
overloads for deque::iterator. Instead of a simple loop over [first, last) we
would split the range into segments on the deque block boundaries, and loop
over [first,n1), [n1, n2), [n3,last) where each of those sub-ranges can use
memcpy.
But std::copy had incorrect semantics for uninitialized_copy, so the
dispatching to std::copy was removed. But that means for the case where we're
copying into a deque we no longer have the custom handling for deque iterators,
and we just do a simple loop over all of [first,last) which can't use memcpy.
More information about the Gcc-bugs
mailing list