Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
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.

/O Options (Optimize Code)

Updated: October 2008

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.

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

Date

History

Reason

October 2008

Made the bulleted list more readable by changing the style of the link text.

Customer feedback.

December 2010

Added information on combining /O options.

Customer feedback.

Community Additions

ADD
Show:
© 2015 Microsoft