HP aC++/HP C A.06.25 Programmer's Guide

aCC +O3 +Onolimit sourcefile.C
or:
aCC +O4 +Onolimit sourcefile.C
By default, the optimizer limits the amount of time spent optimizing large programs
at levels 2, 3, and 4. Use this option if longer compile times are acceptable because you
want additional optimizations to be performed.
Limiting the Size of Optimized Code
You can disable optimizations that expand code size at the second, third, and fourth
optimization levels by using the +Osize suboption, as follows:
aCC +O2 +Osize sourcefile.C
or:
aCC +O3 +Osize sourcefile.C
or:
aCC +O4 +Osize sourcefile.C
Most optimizations improve execution speed and decrease executable code size. A few
optimizations significantly increase code size to gain execution speed. The +Osize
option disables these code-expanding optimizations.
Use this option if you have limited main memory, swap space, or disk space.
Combining Optimization Options
Optimization options that affect code size, (+Osize), compile-time (+Olimit), and
the aggressiveness of the optimizations performed can be combined at any of the
optimization levels 2 through 4.
Profile-Based Optimization
Profile-based optimization (PBO) is a set of performance-improving code
transformations based on the runtime characteristics of your application.
When using profile-based optimization, please note the following:
Numerical applications that perform the same calculations independent of the
input data will only see a small performance boost.
Profile-based optimization has the greatest impact on application performance
when used with level 2 or greater optimizations.
Profile-based optimization benefits most applications, especially large applications
with multiple compilation units, such as compilers, editors, database managers,
and user interface managers.
Profile-based optimization should be enabled during the final stages of application
development. To obtain the best performance, reprofile and reoptimize your
application after making source code changes.
208 Optimizing HP aC++ Programs