/O1, /O2   (Minimize Size, Maximize Speed)

HomeOverviewHow Do ICompiler Options

Feature Only in Professional and Enterprise Editions   Code optimization is supported only in Visual C++ Professional and Enterprise Editions. For more information, see Visual C++ Editions.

These options select a predefined set of options that affect the size and speed of files as follows:

Option Equivalent to Comment
/O1  (Minimize Size) /Og /Os /Oy /Ob1 /Gs /Gf /Gy Creates the smallest code in the majority of cases.
/O2  (Maximize Speed) /Og /Oi /Ot /Oy /Ob1 /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, this option doesn’t use the /G5 option to produce code that is optimized for computers based on the Pentium processor.

These options imply the use of the Frame-Pointer Omission (/Oy) option.

END x86 Specific

To find these options in the development environment, click Settings on the Project menu. Then click the C/C++ tab, and click Optimizations in the Category box. Under Optimizations, click Maximize Speed or Minimize Size.