Gentoo Archives: gentoo-user

From: "Stefan G. Weichinger" <lists@×××××.at>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How to properly change CFLAGS ?
Date: Tue, 22 Aug 2006 07:32:32
Message-Id: 44EAB1AD.7080301@xunil.at
In Reply to: Re: [gentoo-user] How to properly change CFLAGS ? by Richard Fish
1 Richard Fish schrieb:
2 > On 8/21/06, Stefan G. Weichinger <lists@×××××.at> wrote:
3 >> Acer TM 634
4 >> P4-M 1.8GHz (cpu family : 15, model : 2)
5 >> 512 MB RAM
6 >> 30 GB 5200 rpm HDD
7 >
8 > It's all relative. I have a 2.1Ghz Core Duo with 2G of RAM and a
9 > 160Gb HD, so *I* would consider your laptop, um, "underpowered". :-)
10
11 Oh my .... ;)
12 So you see, it is even more important to choose the right flags with
13 such an outdated box ;-)
14
15 > But I also run with -Os. The fact is that some things will run
16 > slightly faster at -Os than -O2, and some things will be slightly
17 > slower. The same applies comparing -O3 to -O2, or -O3 to -Os; it all
18 > depends on what you are doing at the moment.
19 >
20 > So you should not assume that -O3 is faster for some random task just
21 > because it is "more optimized". It simply makes different trade-offs
22 > than -O2 or -Os, and because of the way CPUs and caches work these
23 > days, those trade-offs may help or hurt a particular segment of code.
24 >
25 > FYI, in all of the tests I did, the performance was within 10% of the
26 > median. The real deciding factor for me now is that -Os seems to take
27 > much less time and memory to compile than -O2 or -O3. And being a
28 > ~arch user, time-to-compile is a nice thing to reduce.
29
30
31 I am going the -Os-way now, using your script from your other posting.
32
33 Thanks a lot for the information,
34 Stefan
35 --
36 gentoo-user@g.o mailing list