This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/70898] Stateful Compare objects are very slow
- From: "gccbugs at jbapple dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 04 May 2016 04:00:29 +0000
- Subject: [Bug libstdc++/70898] Stateful Compare objects are very slow
- Auto-submitted: auto-generated
- References: <bug-70898-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70898
gccbugs at jbapple dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|DUPLICATE |---
--- Comment #6 from gccbugs at jbapple dot com ---
I'm not sure I agree that this is a duplicate. In particular, 67085 says that
std::priority_queue operations "should not copy comparators". I suggested that
as well in my initial report, but upon a closer reading of the standard, I'm
not sure that would be conformant, since the standard requires
priorityy_queue::push to call std::push_heap, and std::push_heap has to take
its comparator by value.
On the other hand, I do think that copying comparators *fewer* times that
libstdc++ currently does is permitted, and I think it could have a big
performance benefit in some cases.
In particular, though push_heap seems like it must take the comparator by
value, __push_heap is not required to do so. The constructor for
__gnu_cxx::__ops::_Iter_comp_val and the function
__gnu_cxx::__ops::__iter_comp_val also do not have to take their comparators by
value.