speed and space Optimization

Graham Stoney greyham at research.canon.com.au
Fri Mar 9 10:47:03 EST 2001


On Thu, Mar 08, 2001 at 04:48:21PM +0100, Gabriel Paubert wrote:
> -Os was faster than -O2 which was faster than -O3 for some routines.

I had similar results benchmarking our application on an 855T: -Os was both
smallest and fastest on gcc-2.95.2.  This makes sense since the I-cache on
embedded CPUs is relatively small, and tighter/smaller code takes less time
to fetch.  The difference between -Os and -O2 in terms of speed and space
were only very minor.  -O3 made code larger and slower, by inlining functions
and blowing the cache out too much; I'd strongly recommend against using it.

My suggestion is that the best starting point is to use -Os.

Regards,
Graham
--
Graham Stoney
Assistant Technology Manager
Canon Information Systems Research Australia
Ph: +61 2 9805 2909  Fax: +61 2 9805 2929

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/






More information about the Linuxppc-embedded mailing list