This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]