From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30255 invoked by alias); 31 Dec 2002 12:06:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 30236 invoked by uid 71); 31 Dec 2002 12:06:01 -0000 Resent-Date: 31 Dec 2002 12:06:01 -0000 Resent-Message-ID: <20021231120601.30234.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, dita@cs.technion.ac.il Received: (qmail 17012 invoked by uid 61); 31 Dec 2002 11:57:11 -0000 Message-Id: <20021231115711.17011.qmail@sources.redhat.com> Date: Tue, 31 Dec 2002 04:06:00 -0000 From: dita@cs.technion.ac.il Reply-To: dita@cs.technion.ac.il To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9111: gcc 3.0.4 slow run time reults X-SW-Source: 2002-12/txt/msg01460.txt.bz2 List-Id: >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 #include int main() { for (int i = 0; i < 1000000; ++i) { std::cout << std::string("Hello World!") << std::endl; } return 0; }