Re: [Lse-tech] gcc -O2 vs gcc -Os performance

Andi Kleen
2003-02-06T15:41:55Z

> All done with gcc-2.95.4 (Debian Woody). These machines (16x NUMA-Q) have
> 700MHz P3 Xeons with 2Mb L2 cache ... -Os might fare better on celeron
> with a puny cache if someone wants to try that out.

-Os on 2.95 is not too useful. It only started becomming useful on 3.1+,
even more so on the upcomming 3.3.

e.g. there was one report of ACPI shrinking by >60k by recompiling it
with -Os on 3.1. ACPI is only slow path code so that is completely reasonable.

Best would be of course to use profile feedback to let the compiler
decide where to generate small and where to generate fast&big code.
But that has problems with the maintainability (it will be hard to generate
the same vmlinux as users for debugging/ksymoops reading purposes)

-Andi