delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
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 <elderic AT t-online DOT de> |
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: | <Xns9230986E41EE6marcuselderickoenig@80.91.224.249> |
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 <iostream> #include <set> #include <ctime> #include "benchmark.h" // namespaces to use using namespace std; int main() { set<float> 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<float>::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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |