This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/81476] severe slow-down with range-v3 library compared to clang
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Jul 2017 20:31:24 +0000
- Subject: [Bug libstdc++/81476] severe slow-down with range-v3 library compared to clang
- Auto-submitted: auto-generated
- References: <bug-81476-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81476
--- Comment #17 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #14)
> The advantage of doing it as in comment 13, rather than:
> [comment #11]
> is that when inserting the inputrange causes reallocations we only have to
> transfer the already inserted elements of the inputrange to the new storage,
> not the elements preceding the insertion point ("the beginning of the
> vector" and "what we already inserted at the end").
I see what you mean. Note that as soon as there is some reallocation going on
at any point, we should be able to avoid calling (in-place) rotate, which is
quite a bit more expensive than a simple range move.