Gentoo Archives: gentoo-user

From: Andrey Gerasimenko <gak@××××××.ru>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] CFLAGS "...-O3 -pipe" vs "...O2 <no pipe>"
Date: Mon, 09 Apr 2007 05:52:17
Message-Id: op.tqh406zzv2ynd8@pavillion
In Reply to: [gentoo-user] CFLAGS "...-O3 -pipe" vs "...O2 " by maxim wexler
1 On Mon, 09 Apr 2007 05:48:07 +0400, maxim wexler <blissfix@×××××.com>
2 wrote:
3
4 > Hi group,
5 >
6 > I note two schools of thought on the best CFLAGS for
7 > the Pentium III processor.
8 >
9 > One suggests using -O3 -pipe, the other, -O2 without
10 > the pipe.
11 >
12 > How much difference does this make? Is the extra level
13 > of optimization with pipe the equivalent of the lower
14 > level without?
15 >
16
17 Man gcc. -pipe allows to use pipes (memory) instead of temporary files
18 (disk). -O controls the resulting binary sometimes making it fast, large,
19 and unreliable. I have seen ebuilds that enforce -O2 even when -O3 is
20 specified. This can create a faulty impression that -O3 always works fine.
21
22 -O and -pipe interact through the size of temporary files. Theoretically,
23 -pipes may slow down compiles if there is not enough memory. Another
24 factor that should be taken into account is the number of threads for
25 make. For a PIII machine the generally recommended number is 2, but when
26 the RAM is limited, say 384 megs, 1 thread with pipes works better.
27
28 Ideally you should measure compile times for large projects like Open
29 Office and find out what works best on your system. I would start with 1
30 thread -O2 and -pipe.
31
32 --
33 Andrei Gerasimenko
34 --
35 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] CFLAGS "...-O3 -pipe" vs "...O2 <no pipe>" Neil Bothwick <neil@××××××××××.uk>