|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
/O1, /O2 (Minimize Size, Maximize Speed)
These options select a predefined set of options that affect the size and speed of files as follows:
|/O1 (Minimize Size)||/Og /Os /Oy /Ob2 /Gs /GF /Gy||Creates the smallest code in the majority of cases.|
|/O2 (Maximize Speed)||/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy||Creates the fastest code in the majority of cases. (Default setting for release builds)|
x86 Specific >
You can use other options to improve the size or speed of many applications (for example, the /G5 option to generate code optimized for the Pentium processor).
These options imply the use of the Frame-Pointer Omission (/Oy) option.
END x86 Specific
To set this compiler option in the Visual Studio development environment
- Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
- Click the C/C++ folder.
- Click the Optimization property page.
- Modify the Optimization property.
To set this compiler option programmatically