public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cline at parashift dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/13351] New: 10x slower execution speed GCC 3.3 (compared with GCC 3.2) Date: Mon, 08 Dec 2003 07:28:00 -0000 [thread overview] Message-ID: <20031208072839.13351.cline@parashift.com> (raw) The execution speed of the following simple program is 10x slower on GCC 3.3 than on GCC 3.2 (using cygwin; I haven't tested Linux yet). To reproduce, save it and compile with: g++ -Wall -pedantic -O -DNDEBUG speedtest2.cpp ======================================================================== #include <iostream> #include <string> #include <vector> #include <map> #include <sys/types.h> #include <sys/timeb.h> inline double timeToMillisec() { timeb x; // Change to _timeb with MSVC++ ftime(&x); // Change to _ftime with MSVC++ return double(x.time) + double(x.millitm)/1000.0; } typedef std::string String; typedef std::vector<String> List; typedef std::map<String,List> Map; List foo(unsigned numEntries) { List v; for (unsigned i = 0u; i < numEntries; ++i) v.push_back(String("foo") + char(i % 256)); return v; } Map bar(unsigned numEntries, List v) { Map m; for (unsigned i = 0u; i < numEntries; ++i) m[String("foo") + char(i % 256)] = v; return m; } int main() { const unsigned perIteration = 1000u; std::cout << "Testing: " << std::flush; const double begin = timeToMillisec(); double elapsed; unsigned total = 0u; do { bar(perIteration, foo(perIteration)); total += perIteration * perIteration; elapsed = timeToMillisec() - begin; } while (elapsed < 1.0); std::cout << total << " in " << elapsed << " sec = " << (elapsed * 1000.0 * 1000.0 / total) << " ns/per\n"; return 0; } ======================================================================== -- Summary: 10x slower execution speed GCC 3.3 (compared with GCC 3.2) Product: gcc Version: 3.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: cline at parashift dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13351
next reply other threads:[~2003-12-08 7:28 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-12-08 7:28 cline at parashift dot com [this message] 2003-12-08 7:43 ` [Bug c++/13351] [3.3 Regression] " pinskia at gcc dot gnu dot org 2003-12-08 10:38 ` [Bug c++/13351] [3.3 Regression] 10x slower generated code (GCC 3.3 compared " cline at parashift dot com 2003-12-08 10:42 ` cline at parashift dot com 2003-12-08 11:16 ` [Bug libstdc++/13351] " pinskia at gcc dot gnu dot org 2003-12-08 12:10 ` [Bug libstdc++/13351] [3.3 Regression] Generated code is noticeable slower (compared to 3.2) giovannibajo at libero dot it 2003-12-08 13:00 ` cline at parashift dot com 2003-12-08 13:09 ` [Bug libstdc++/13351] [3.3 Regression] BIG slowdown in generated code " giovannibajo at libero dot it 2003-12-08 13:31 ` falk at debian dot org 2003-12-08 15:33 ` carlo at alinoe dot com 2003-12-08 17:38 ` gdr at integrable-solutions dot net 2003-12-09 21:30 ` bkoz at gcc dot gnu dot org 2003-12-13 22:02 ` cline at parashift dot com 2003-12-23 10:01 ` pinskia at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20031208072839.13351.cline@parashift.com \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).