Steps for reducing code size
This section outlines some steps for reducing code size:
- Ensure that you have built a stable application that compiles at -O2 or higher.
- Use performance analysis tools to isolate high activity code segments
and tune for performance where appropriate. Basing decisions for code size
tuning on an application that has already undergone performance analysis will
give you more information on where your application could benefit from code
size tuning.
- Use compiler options like -qcompact that can help
reduce code size. See Compiler option influences
on code size for more information.
Be aware that optimization can cause code to expand significantly through
loop unrolling, invariant IF floating, inlining, and other optimizations.
The higher your optimization level, the more code size can increase. For more
information on finding an optimization level appropriate for your application,
see Optimizing XL Compiler Programs.