This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/9111: gcc 3.0.4 slow run time reults
- From: dita at cs dot technion dot ac dot il
- To: gcc-gnats at gcc dot gnu dot org
- Date: 31 Dec 2002 11:57:11 -0000
- Subject: c++/9111: gcc 3.0.4 slow run time reults
- Reply-to: dita at cs dot technion dot ac dot il
>Number: 9111
>Category: c++
>Synopsis: gcc 3.0.4 slow run time reults
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Dec 31 04:06:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Dr. Yechiel Kmichi
>Release: gcc version 2.95.3 20010315 (release) and Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.4/specs
>Organization:
>Environment:
gcc version 2.95.3 20010315 (release)
And
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.4/specs
Configured with: ../configure --enable-libgcj
Thread model: posix
gcc version 3.0.4
Kernel version: SunOS 5.8 Generic 108528-15 April 2002
>Description:
WE have here two simple C++ programs (to compare efficiency)
[For the record:
HelloWorld1.cc is doing
int
main()
{
for (int i = 0; i < 1000000; ++i) {
std::cout << "Hello World!" << std::endl;
}
return 0;
}
and HelloWorld2.cc is doing
int
main()
{
for (int i = 0; i < 1000000; ++i) {
std::cout << std::string("Hello World!") << std::endl;
}
return 0;
}
The problem is that any version of these runs 8 times FASTER
if compiled under g++ 2.95.3 (CSA-E450 Solaris 8)
than if compiled under g++ 3.0.4 (CSD-E3500 Solaris 8)
[note that only CSD can run both executables, with a minor speedup]
and timing was stored in corresponding files with -time-cs[ad]
more HW1-2.95.3-time-csa
8.0u 4.0s 0:12 94% 0+0k 0+0io 0pf+0w
more HW1-3.0.4-time-csd
57.0u 46.0s 1:45 97% 0+0k 0+0io 0pf+0w
more HW2-2.95.3-time-csd
11.0u 3.0s 0:15 88% 0+0k 0+0io 0pf+0w
more HW2-3.0.4-time-csd
62.0u 47.0s 1:50 98% 0+0k 0+0io 0pf+0w
>How-To-Repeat:
Compilethis source file once with gcc version 2.95 and once with version 3.0.4 and msure its runtime in both cases.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="HelloWorld2.cc"
Content-Disposition: inline; filename="HelloWorld2.cc"
#include <iostream>
#include <string>
int
main()
{
for (int i = 0; i < 1000000; ++i) {
std::cout << std::string("Hello World!") << std::endl;
}
return 0;
}