public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/51965] New: Redundant move constructions in heap algorithms
@ 2012-01-23 13:55 valyala at gmail dot com
  2012-01-23 14:04 ` [Bug libstdc++/51965] " valyala at gmail dot com
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: valyala at gmail dot com @ 2012-01-23 13:55 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51965

             Bug #: 51965
           Summary: Redundant move constructions in heap algorithms
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: valyala@gmail.com


Created attachment 26426
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26426
Eliminate unnecessary move constructions in stl_heap.h

Currently Heap implementation (
http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/include/bits/stl_heap.h?revision=181987&view=markup
) contains redundant move constructions. These constructors are invoked when
passing rvalue __value to std::__push_heap() and std::__adjust_heap(). It would
be better passing the __value into these functions by reference instead. This
eliminates redundant move constructions and results in 3x reduction of the
number of move constructor calls inside heap functions such as make_heap() and
sort_heap().

See the attached patch for details.


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2020-03-29 19:20 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-23 13:55 [Bug libstdc++/51965] New: Redundant move constructions in heap algorithms valyala at gmail dot com
2012-01-23 14:04 ` [Bug libstdc++/51965] " valyala at gmail dot com
2012-01-23 14:10 ` chris at bubblescope dot net
2012-01-23 14:52 ` redi at gcc dot gnu.org
2012-01-23 15:40 ` paolo.carlini at oracle dot com
2012-01-23 23:46 ` marc.glisse at normalesup dot org
2012-01-24  1:16 ` paolo.carlini at oracle dot com
2012-01-24 11:08 ` marc.glisse at normalesup dot org
2012-01-24 13:04 ` paolo.carlini at oracle dot com
2013-07-25  8:34 ` redi at gcc dot gnu.org
2013-09-06  9:52 ` glisse at gcc dot gnu.org
2014-04-22 11:36 ` jakub at gcc dot gnu.org
2014-07-16 13:28 ` jakub at gcc dot gnu.org
2014-10-30 10:38 ` jakub at gcc dot gnu.org
2015-06-26 20:03 ` jakub at gcc dot gnu.org
2015-06-26 20:30 ` jakub at gcc dot gnu.org
2020-03-29 19:20 ` glisse at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).