public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58437] New: Sorting value in reverse order is much slower compare to gcc44
@ 2013-09-16 20:37 tammy at Cadence dot COM
  2013-09-16 21:06 ` [Bug c++/58437] " glisse at gcc dot gnu.org
                   ` (28 more replies)
  0 siblings, 29 replies; 30+ messages in thread
From: tammy at Cadence dot COM @ 2013-09-16 20:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58437
           Summary: Sorting value in reverse order is much slower compare
                    to gcc44
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tammy at Cadence dot COM

For the following testcase:

=======================================================
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
    const size_t num = 10000000;
    vector<int> v(num);

    generate(v.begin(), v.end(), &rand);
    sort(v.begin(), v.end());
    sort(v.rbegin(), v.rend());
}
======================================================

If we compile it with "g++ -O3", it takes 1 sec to sort random
values with either gcc445 or gcc481. Gcc445 takes 0.33 sec to sort
value in reverse order, but gcc 4.7/4.8 takes 2 secs.

Is there any way to improve the run-time performance?


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

end of thread, other threads:[~2013-09-30 17:44 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-16 20:37 [Bug c++/58437] New: Sorting value in reverse order is much slower compare to gcc44 tammy at Cadence dot COM
2013-09-16 21:06 ` [Bug c++/58437] " glisse at gcc dot gnu.org
2013-09-16 21:18 ` glisse at gcc dot gnu.org
2013-09-17  0:03 ` paolo.carlini at oracle dot com
2013-09-17  1:02 ` paolo.carlini at oracle dot com
2013-09-17  1:08 ` [Bug libstdc++/58437] [4.7/4.7/4.9 Regression] " paolo.carlini at oracle dot com
2013-09-17  1:19 ` paolo.carlini at oracle dot com
2013-09-17  7:51 ` [Bug libstdc++/58437] [4.7/4.8/4.9 " rguenth at gcc dot gnu.org
2013-09-17  9:02 ` chris at bubblescope dot net
2013-09-17  9:06 ` paolo.carlini at oracle dot com
2013-09-17 16:44 ` tammy at Cadence dot COM
2013-09-17 16:53 ` jmbnyc at gmail dot com
2013-09-17 17:28 ` tammy at Cadence dot COM
2013-09-17 18:38 ` jmbnyc at gmail dot com
2013-09-19  8:18 ` glisse at gcc dot gnu.org
2013-09-19  9:13 ` paolo.carlini at oracle dot com
2013-09-19 10:10 ` paolo.carlini at oracle dot com
2013-09-19 11:28 ` glisse at gcc dot gnu.org
2013-09-19 14:10 ` paolo.carlini at oracle dot com
2013-09-19 14:46 ` chris at bubblescope dot net
2013-09-19 14:51 ` jmbnyc at gmail dot com
2013-09-19 17:10 ` tammy at Cadence dot COM
2013-09-19 17:35 ` paolo.carlini at oracle dot com
2013-09-19 17:37 ` tammy at Cadence dot COM
2013-09-19 18:35 ` glisse at gcc dot gnu.org
2013-09-23 20:45 ` tammy at Cadence dot COM
2013-09-30 17:42 ` paolo at gcc dot gnu.org
2013-09-30 17:42 ` paolo at gcc dot gnu.org
2013-09-30 17:43 ` paolo at gcc dot gnu.org
2013-09-30 17:44 ` paolo.carlini at oracle dot com

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).