Share via


/O Options (Optimize Code)

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at -O Options (Optimize Code).

The /O options control various optimizations that help you create code for maximum speed or minimum size.

  • /O1 optimizes code for minimum size.

  • /O2 optimizes code for maximum speed.

  • /Ob controls inline function expansion.

  • /Od disables optimization, speeding compilation and simplifying debugging.

  • /Og enables global optimizations.

  • /Oi generates intrinsic functions for appropriate function calls.

  • /Os tells the compiler to favor optimizations for size over optimizations for speed.

  • /Ot (a default setting) tells the compiler to favor optimizations for speed over optimizations for size.

  • /Ox selects full optimization.

  • /Oy suppresses the creation of frame pointers on the call stack for quicker function calls.

Remarks

You can also combine multiple /O options into a single option statement. For example, /Odi is the same as /Od /Oi.

See Also

Compiler Options
Setting Compiler Options