This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
/O options (Optimize Code)
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.
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.
- /Oa tells the compiler to assume your program does not use aliasing.
- /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.
- /Op disables optimizations that could change the precision of floating-point numbers.
- /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.
- /Ow tells the compiler that your program does not use aliasing within functions but may use aliasing across functions calls.
- /Ox selects full optimization.
- /Oy suppresses the creation of frame pointers on the call stack for quicker function calls.
IDE Settings (Project Settings dialog box)
To set these optimization options in the development environment, open the Project Settings dialog box, choose the C/C++ tab, and choose Optimizations in the Category box. In the in the Optimizations list box, select an optimization setting—Default, Disable (Debug), Maximize Speed, Minimize Size, or Customize. If you select Customize, you can select specific optimizations in the area below the list box.
See Also
Compiler Options | Setting Compiler Options