Gentoo Archives: gentoo-amd64

From: Daniel Iliev <danny@××××××××.com>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] First Impressions
Date: Thu, 28 Sep 2006 01:00:05
Message-Id: 451B1DDB.1020302@ilievnet.com
In Reply to: Re: [gentoo-amd64] First Impressions by "Boyd Stephen Smith Jr."
1 Boyd Stephen Smith Jr. wrote:
2 > On Wednesday 27 September 2006 11:11, "Hemmann, Volker Armin"
3 > <volker.armin.hemmann@××××××××××××.de> wrote about 'Re: [gentoo-amd64]
4 > First Impressions':
5 >
6 >> -O3 don't do it. O2 is much, much safer and not really slower. It will
7 >> prevent a lot of breakage.
8 >>
9 >
10 > Bah!
11 >
12 > -O3 breaking just doesn't happen anymore. I'm been running it for years.
13 > In fact -O3 has never generated invalid code [1] on x86 or amd64
14 > platforms. It did for a period of time on ppc, but I think that was like
15 > 10 years ago.
16 >
17 > Also, some applications break with just -O2. I count 8 ebuilds that
18 > replace this cflag specifically, there could be others that filter it or
19 > filter/replace optimization options entirely. My methodology is available
20 > on request.
21 >
22 > Now, it is an open question whether -O3 is significantly faster than -O2
23 > and depending on a number of factors it may actually be slower. -O3 will
24 > enlarge code to make execution paths shorter, but a cache miss is probably
25 > goes to blow away any advantage gained. Conversely, -Os will make
26 > execution paths longer to shrink code, and a cache hits may make up for
27 > the longer path. [2]
28 >
29 > So, which is best depends on the program and on the CPU used (not only
30 > instruction set, but also cache sizes). Therefore, making a sweeping
31 > recommendations is not recommended, but that doesn't stop anyone. My
32 > recommendation is -O3. :)
33 >
34 > Naturally, Gentoo wins over binary distros on this point, since you can use
35 > CFLAGS that are appropriate for your specific processor (including cflags
36 > which control the optimization tradeoff parameters) as well as tuning for
37 > the specific application.
38 >
39 >
40 I've always used "-O3". The only exception is busybox, when I compile it
41 for initrd/initramfs. In those cases I prefer "-Os". I've never seen a
42 package which explodes with "-O3" and compiles with "-O2". That's the
43 reason I hate to find that "replace-flags -O? -O2" stuff in the ebuilds.
44 I think I've read somewhere in *.gentoo.org that It should be reported
45 if a "testing" version works fine so it could get in the stable tree
46 faster. Should this "replace-flags" stuff be reported when the package
47 compiles successfully with "-O3"?
48
49
50 --
51 Best regards,
52 Daniel
53
54
55 --
56 gentoo-amd64@g.o mailing list

Replies

Subject Author
Re: [gentoo-amd64] First Impressions "Boyd Stephen Smith Jr." <bss03@××××××××××.net>