Hi Christophe,

I think we had this discussion on "-Os" Vs "-O2" (size vs speed) long time
back for super-fast booting. I believe we can reach midway if Kernel
compilation is done using "-O2" and the rest is compiled with "-Os".

 From phoronix , you can see that in some cases "-Os" works better in
performance than "-O2" (
http://global.phoronix-test-suite.com/index.php?k=profile&u=staalmannen-231-8340-1312).
The reason is that "-Os" produces small executables and the CPU takes lesser
time to move data around cache. The new intel chips, however, now contain
pre-caching to improve performance gains for "bigger" executables produced
by "-O2". So, as Alexander points out that playing with cache size
parameters may be really helpful too.
It is also possible that some binaries may not compile with "-Os".

My take is to use a midway: compile kernel with "-O2"; compile rest (as long
as the binary compiles) with "-Os"

Useful links (from google) for you to decide:
* http://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/Optimize-Options.html
*
http://phoronix.com/forums/showthread.php?29090-CompilerDeathMatch-surprising-results/page2

Thanks

Rohit

On Sun, May 22, 2011 at 3:50 AM, Alexander Medvedev <[email protected]>wrote:

> >Less perf on what ?
>
> Runtime performance. -Os disables code and data alignment (-falign-*), that
> saves space, but decreases speed on CPUs without efficient unaligned access.
> According to google and some testing not long ago on Phoronix and
> linux.org.ru, it is a compromise between ~10% saved space or 10% of
> performance.
>
> A small suggestion - try playing with LTO and l1/l2 cache size parameteres.
>

Reply via email to