Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com X-Injected-Via-Gmane: http://gmane.org/ Path: not-for-mail From: Marcus Elderic Koenig Newsgroups: gmane.os.cygwin Subject: gcc 3.1 slower than 2.95? Date: Mon, 17 Jun 2002 12:58:45 +0000 (UTC) Organization: none Lines: 109 Message-ID: NNTP-Posting-Host: pd9511f0e.dip.t-dialin.net X-Trace: main.gmane.org 1024318725 21092 217.81.31.14 (17 Jun 2002 12:58:45 GMT) X-Complaints-To: usenet AT main DOT gmane DOT org NNTP-Posting-Date: Mon, 17 Jun 2002 12:58:45 +0000 (UTC) User-Agent: Xnews/5.04.25 now I compiled gcc 3.1 and tested it and I got confused again :) everywhere I read 3.1 being about 30% faster than 2.95, but my tests show the exact opposite. I did compile with: ./configure --enable-threads=win32 make bootstrap make install and I did set the library_path to the correct paths. now when I compile the following source with gcc3 (previously compiled with gcc 2.95), I get the following results: ------------------------------------------------------------------------ // STL includes #include #include #include #include "benchmark.h" // namespaces to use using namespace std; int main() { set storage; headroom__base::benchmark bench; bench.start(); int i; cout << "inserting... " << endl; for (i = 0; i < 500000; i++) { storage.insert(i); storage.insert(3.14); }; cout << "insert ready." << endl << "inserted floats: " << storage.size() << endl << endl << "referencing... " << endl; set::const_iterator setPos; for (i = 0; i < 500000; i++) { setPos = storage.find(i); }; cout << "referencing ready." << endl << endl; cout << "in one second, I do " << CLOCKS_PER_SEC << " ticks." << endl << "all this took me " << clock() << " ticks and " << bench.stop() << " seconds." << endl; return 0; }; ------------------------------------------------------------------------ -> gcc 2.95 g++ -O2 -mcpu=pentium -Wall settest.cpp -lwinmm -> gcc 3.1 g++ -O3 -mcpu=pentium -Wall settest.cpp -lwinmm results: C:\elderic\source\compiler speedtest>"gcc 2.95.exe" inserting... insert ready. inserted floats: 500001 referencing... referencing ready. in one second, I do 1000 ticks. all this took me 1902 ticks and 1.852 seconds. C:\elderic\source\compiler speedtest>gcc3 inserting... insert ready. inserted floats: 500001 referencing... referencing ready. in one second, I do 1000 ticks. all this took me 3594 ticks and 3.665 seconds. ---------------------------------------------------------------- this is not 30% faster, but about 70% slower???????????? can someone please tell me why this happens??? -elderic -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/