Ive been doing quite a lot of this stuff lately.  Make a small script
that contains all the make options you are considering and compile and
time the program looking for the best combination.  Takes forever, and
is specific to that application.

On all the machines (athlon t-bird, p4) I have tried so far, -O3 always
decreases performance - O2 is best (dramatically so on something like a
celery).  Most of the other options you see mentioned on the list show a
small incremental advantage, except for -falign-functions=4 which also
slows things down.  Making this 32 gives a small advantage though.

As well as your program, you may need to optimise any dynamic libs that
it relies on, as well as system services.

Testing has also shown that something as simple as running an
application in a frame-buffer, as against an xterm can slow an
application that writes to the screen by ~10% (X is faster!)

What does "ldd mybinary" show?, and what were the original flags in
make.conf?  Did you recompile the whole OS after changing make.conf?

There are so many variables, including kernel options that comparing one
distro to another is fraught with difficulty, and gentoo is at a
disadvantage here as most users do not have the knowledge to pick the
best options, whilst debian et al are conservative, but set up by very
experianced people.

BillK

On Wed, 2003-10-22 at 03:56, Matt Garman wrote:
> I just got a new hard disk and installed gentoo on it.  I've got a c++
> development project that I was working on that runs noticeably slower on
> my gentoo box than it did on under my debian unstable installation.
> 
> I basically wrote a CSV file reader in C++.  The implementation uses a
> vector of vectors (one vector per row for each field, and a vector for
> every row).  In other words:
> 
>       std::vector< std::vector< std::string > > data;
> 
> Anyway, my data file has roughly 50,000 records.  Under the Debian
> system, it took, on average, two or three seconds to load this data into
> memory.  However, under the Gentoo system, it takes eight or nine
> seconds on average to load the data.  (Run times don't change
> appreciably between subsequent runs, so I don't think caching is the
> issue here.)
> 
> That's a pretty dramatic change, in my opinion.  No hardware on my
> system has changed (except the new disk, which I have verified is not
> the source of the slowdown (it's a 10k SCSI drive, should be faster if
> anything)).
> 
> I haven't changed any compile settings from one system to the other.
> Just for kicks, I tried using the optimising options I'm using for
> Gentoo in my /etc/make.conf: "-O3 -march=athlon-xp -pipe".  That knocked
> a couple seconds off the load time, but the Debian-compiled version is
> still much faster.
> 
> For what it's worth, the Debian system used:
> 
> g++ (GCC) 3.3.2 20030908 (Debian prerelease)
> 
> And the Gentoo system is using:
> 
> g++ (GCC) 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r2, propolice)
> 
> Looks like Debian's is a bit newer.  I don't follow gcc development
> really---have their been drastic improvements in a minor revision?
> 
> Tonight I plan to setup grub to boot the old system to do some more
> investigating.
> 
> Thanks for any comments or thoughts!
> Matt
> 
> 
> 
> --
> [EMAIL PROTECTED] mailing list
-- 
William Kenworthy <[EMAIL PROTECTED]>


--
[EMAIL PROTECTED] mailing list

Reply via email to