public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/54075] New: [4.7.1] unordered_map 3x slower than 4.6.2
@ 2012-07-23 23:07 likan_999.student at sina dot com
  2012-07-23 23:08 ` [Bug libstdc++/54075] " likan_999.student at sina dot com
                   ` (47 more replies)
  0 siblings, 48 replies; 49+ messages in thread
From: likan_999.student at sina dot com @ 2012-07-23 23:07 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54075
           Summary: [4.7.1] unordered_map 3x slower than 4.6.2
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: likan_999.student@sina.com


The following piece of code shows 3x performance regression from 4.6.2 to
4.7.1.  The reason should come from the change in libstdc++.  The code is
compiled with -O2 -std=c++0x. -O3 doesn't make much difference; with or without
the call to reserve doesn't make much difference.  The attachment contains
profiling using google-perftool.  Looks like the major cost comes from the
rehashing.  Does anyone aware of the issue, or I am the first one to report
this?


#include <unordered_map>

using namespace std;

int main() {
    const int N = 10000000;
    unordered_map<int, int> m;
    m.reserve(2 * N);
    for (int i = 0; i < N; i++) {
        m[i] = i;
    }
}


Timing:
[hidden]$ time ./a-4.6.2.out 

real    0m1.029s
user    0m0.787s
sys    0m0.239s
[hidden]$ time ./a-4.7.1.out 

real    0m3.364s
user    0m2.596s
sys    0m0.761s


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

end of thread, other threads:[~2012-11-08 21:19 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-23 23:07 [Bug libstdc++/54075] New: [4.7.1] unordered_map 3x slower than 4.6.2 likan_999.student at sina dot com
2012-07-23 23:08 ` [Bug libstdc++/54075] " likan_999.student at sina dot com
2012-07-23 23:09 ` likan_999.student at sina dot com
2012-07-23 23:12 ` paolo.carlini at oracle dot com
2012-07-23 23:23 ` paolo.carlini at oracle dot com
2012-07-24  0:17 ` likan_999.student at sina dot com
2012-07-24  0:29 ` paolo.carlini at oracle dot com
2012-07-24  0:43 ` likan_999.student at sina dot com
2012-07-24 10:42 ` plasmahh at gmx dot net
2012-07-24 20:15 ` fdumont at gcc dot gnu.org
2012-07-24 20:19 ` fdumont at gcc dot gnu.org
2012-07-25  9:56 ` paolo.carlini at oracle dot com
2012-07-25 19:33 ` fdumont at gcc dot gnu.org
2012-07-26 12:30 ` plasmahh at gmx dot net
2012-07-26 12:32 ` fdumont at gcc dot gnu.org
2012-07-26 17:36 ` paolo.carlini at oracle dot com
2012-07-26 22:10 ` likan_999.student at sina dot com
2012-07-26 22:50 ` chip at pobox dot com
2012-07-26 22:55 ` paolo.carlini at oracle dot com
2012-07-26 23:39 ` [Bug libstdc++/54075] [4.7.1] unordered_map insert " chip at pobox dot com
2012-07-27  0:33 ` redi at gcc dot gnu.org
2012-07-27  1:00 ` chip at pobox dot com
2012-07-27  7:58 ` fdumont at gcc dot gnu.org
2012-07-27 19:21 ` plasmahh at gmx dot net
2012-07-29 16:44 ` fdumont at gcc dot gnu.org
2012-07-29 17:06 ` fdumont at gcc dot gnu.org
2012-09-26 23:11 ` paolo.carlini at oracle dot com
2012-10-22 20:50 ` cracauer at cons dot org
2012-10-22 21:05 ` paolo.carlini at oracle dot com
2012-10-22 22:04 ` cracauer at cons dot org
2012-10-22 22:47 ` paolo.carlini at oracle dot com
2012-10-24 19:28 ` fdumont at gcc dot gnu.org
2012-10-25 17:48 ` cracauer at cons dot org
2012-10-26 14:35 ` paolo.carlini at oracle dot com
2012-11-03 15:28 ` fdumont at gcc dot gnu.org
2012-11-04  4:55 ` foom at fuhm dot net
2012-11-05 12:55 ` [Bug libstdc++/54075] [4.7.1] unordered_map insert still " paolo.carlini at oracle dot com
2012-11-05 22:12 ` tlawrence85 at gmail dot com
2012-11-06  0:59 ` paolo.carlini at oracle dot com
2012-11-06 21:23 ` fdumont at gcc dot gnu.org
2012-11-06 21:34 ` paolo.carlini at oracle dot com
2012-11-07 22:03 ` frs.dumont at gmail dot com
2012-11-08  0:59 ` jwakely.gcc at gmail dot com
2012-11-08  1:56 ` paolo.carlini at oracle dot com
2012-11-08  2:26 ` paolo.carlini at oracle dot com
2012-11-08 20:06 ` fdumont at gcc dot gnu.org
2012-11-08 20:16 ` fdumont at gcc dot gnu.org
2012-11-08 20:21 ` frs.dumont at gmail dot com
2012-11-08 21:19 ` frs.dumont at gmail 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).