From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9065 invoked by alias); 12 Mar 2007 21:42:38 -0000 Received: (qmail 9057 invoked by uid 22791); 12 Mar 2007 21:42:38 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 12 Mar 2007 21:42:34 +0000 Received: from spaceape11.eur.corp.google.com (spaceape11.eur.corp.google.com [172.28.16.145]) by smtp-out.google.com with ESMTP id l2CLgTRp032116 for ; Mon, 12 Mar 2007 21:42:29 GMT Received: from nz-out-0506.google.com (nzii11.prod.google.com [10.36.35.11]) by spaceape11.eur.corp.google.com with ESMTP id l2CLgMDd021478 for ; Mon, 12 Mar 2007 21:42:23 GMT Received: by nz-out-0506.google.com with SMTP id i11so1065950nzi for ; Mon, 12 Mar 2007 14:42:22 -0700 (PDT) Received: by 10.35.50.1 with SMTP id c1mr12807471pyk.1173735740592; Mon, 12 Mar 2007 14:42:20 -0700 (PDT) Received: by 10.35.125.17 with HTTP; Mon, 12 Mar 2007 14:42:20 -0700 (PDT) Message-ID: <29bd08b70703121442t199859d7h3c0159c2dc1a4c15@mail.gmail.com> Date: Mon, 12 Mar 2007 22:06:00 -0000 From: "Lawrence Crowl" To: "Shane R" Subject: Re: Linux c++ opmization--- linux runs at half the speed of windows? Cc: gcc-help@gcc.gnu.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2007-03/txt/msg00167.txt.bz2 Is your windows compiler doing automatic parallelization by chance? Twice as fast on a dual core processor is a bit too coincidental. :-) On 3/8/07, Shane R wrote: > Hi, > > I hope this is the appropriate forum. Please direct me to the correct one if > it is not. > > I am trying to optimize a c++ application that I ported from a windows > system to Linux. > The app is a terminal based application that does some one time file io at > the start then runs completely in memory. After the one time io the app runs > successive timed epochs on the same data in Windows as Linux. The app is a > program that runs some code for doing non-linear optmization (math stuff). > > The reason why I am posting is that I timed the time it takes for the > application to complete an epoch. It take twice as long in Linux as > windows?!?! > > My system is an Intel Centrino Duo with 2gigs of ram. The application is > only using a fraction of available memory in windows and linux. The > application is single-threaded in both. > > I am using Visual Studio 2003 in Windows and when I type gcc -v I get: > Target: i486-linux-gnu > Configured with: ../src/configure -v > --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr > --enable-shared --with-system-zlib --libexecdir=/usr/lib > --without-included-gettext --enable-threads=posix --enable-nls > --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu > --enable-libstdcxx-debug --enable-mpfr --enable-checking=release > i486-linux-gnu > Thread model: posix > gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5) > > > > I am currently using these g++ options: > > CFLAGS = -o3 -O3 -march=pentium4 -ffast-math -funroll-loops -Wall > -Wno-return-type > > But I have tried every permutation of the above options to virtually no > effect > > The average run time of an epoch in windows is about 3000 milliseconds while > the average run time of an epoch in Linux is 6000! > > I don't know if it matters but I am doing calls to the rand() function in > both my windows and linux apps. > > On another note does anyone have any experience with the Intel drop in > replacement for GCC? > > Thanks in advance for any help, > > Shane > > _________________________________________________________________ > Match.com - Click Here To Find Singles In Your Area Today! > http://match.engb.msn.com/ > > -- Lawrence Crowl