[Bug libstdc++/81476] severe slow-down with range-v3 library compared to clang

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 19 07:27:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81476

--- Comment #11 from Marc Glisse <glisse at gcc dot gnu.org> ---
Or one could (not legal) directly start a new allocation, copy the beginning of
the vector, append the range, then append the end of the vector. Or a
combination of all that: first try appending the range to the vector. If that
works without reallocating, rotate. If a reallocation is necessary, switch to
the "new allocation" strategy, create a new vector, copy the beginning of the
vector, copy what we already inserted at the end, append the rest of the
inputrange, copy the rest of the original vector, and finally adopt this new
vector.


More information about the Gcc-bugs mailing list