Optimizing with Help from the Compiler

It is possible to have the compiler perform optimizations on the executable code it generates. This is a very cheap form of optimization as no extra development effort is needed for finding places to optimize and performing the actual code optimizations. Only compiling the sources will possibly take longer, but this extra time is negligible. How and when to instruct the compiler to perform optimizations will be explained in the following sections.

Optimizing with Compiler Optimization Options

Most compilers will perform only basic code translation optimizations when invoked without specific optimization instructions. It is possible, however, to instruct compilers to do more optimization on the output ...

Get C++ Footprint and Performance Optimization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.