4.1.1. Optimizing for size versus speed

The compiler provides two options for optimizing code size and performance:

-Ospace

This option causes the compiler to optimize mainly for code size. This is the default option.

-Otime

This option causes the compiler to optimize mainly for speed.

For best results, you must build your application using the most appropriate command-line option.

Note

For small functions, it is not guaranteed that -Otime always generates faster code, or that -Ospace always generates smaller code. The exact outcome of a particular optimization cannot be determined until all optimizations have been applied, at which point it is too late to undo any optimizations.

For more information see:

Copyright © 2002-2007 ARM Limited. All rights reserved.ARM DUI 0205H
Non-Confidential