speed and space Optimization
Gabriel Paubert
paubert at iram.es
Fri Mar 9 02:48:21 EST 2001
On Thu, 8 Mar 2001, Srinivas Rao.M wrote:
>
> Ok. thanks for the reply Mr. Gabriel. How can i do the bench marking of
> these options. Can i get some more information from somewhere on net.
> -Srini...
Try "info gcc" for the optimization and machine specific options. There
are also specialized gcc mailing lists, but first read the documentation
before bothering the people on the lists.
The best benchmark is *always* the code that you want to run. On my tests
the difference between size and speed optimizations was always small
(although above the noise level), and sometimes surprising (-Os was faster
than -O2 which was faster than -O3 for some routines). The only thing you
can count on is that -O0 will generate the biggest and slowest code by
far, -O1 will make it already much smaller and faster, but still
noticeably slower than any of the higher optimization options.
But every application is different and you might notice a bigger impact
than me depending on processor and compiler options (I did these tests
about 18 months ago, compiler has improved since then but of course not as
much as we would like).
Lies, damn lies, statistics, and benchmarks...
Regards,
Gabriel.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
More information about the Linuxppc-embedded
mailing list