On Tue, Sep 15, 2009 at 11:05 PM, Paolo Falcone <[email protected]> wrote: > The "never ever use -O3" isn't an absolute rule. > > What the -O3 optimization flag does are turning on the following > options: -finline-functions, -funswitch-loops, -fpredictive-commoning, > -fgcse-after-reload and -ftree-vectorize. These, when coupled with > good code, can produce remarkable differences if you compare them with > the results from -O2 given that the compiler is free to optimize the > code by inlining functions, using vectorization on tree structures > (rather than processing it serially), .It is true that with inlining, > etc, there's a possibility that you can get bigger binaries and > greater memory usage - but at the price of faster performing code. > > There are other known flags that you can use like -findirect-inlining > that you can use if you compile with profile-guided optimizations. > > Use these if you know your code well. Otherwise, refer to the rule of > thumb. There has been tons of improvements in the 4.x line, especially > if you're into C++. But those aren't excuses for unnecessary "ricing". > > Hard disk and memory are getting cheaper nowadays... long ago 4GB of > RAM and 500GB of disk space is something you'll spend beyond 5 > digits... > > if you can produce static binaries for performance-sensitive stuff > that will be better. > >
Let say I use your fancy gcc flags with -O3 on my Linux distro, how much performance will my dual-core laptop will get? .5%? .10%? vs with the -O2 that is stable and reliable. What I mean with "never ever use -O3" was building *ALL* linux packages with -O3, specially critical OS related libs. I don't think those gcc flags with -O3 is applicable. We are talking about Linux Distro here not a specific C/C++ application ;) 5 pesos for my favorite Linux distro with -O2 flags, peace! -- Jimmy B. Lim j i m m y b l i m @ g m a i l . c o m _________________________________________________ Philippine Linux Users' Group (PLUG) Mailing List http://lists.linux.org.ph/mailman/listinfo/plug Searchable Archives: http://archives.free.net.ph

