[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:12:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81476
--- Comment #10 from Marc Glisse <glisse at gcc dot gnu.org> ---
Inserting an InputRange (not even Forward) at the beginning of a vector is
really a misuse of vector. It is true that we can do better than what libstdc++
currently does, though we shouldn't encourage the practice. Trivial idea would
be first to copy the InputRange to some array (either something dynamic like a
vector, or by block to a fixed size buffer), then insert that. Variants include
tricks like inserting the InputRange at the end of the vector, then calling
std::rotate to move it to the right position.
More information about the Gcc-bugs
mailing list