Skip to content

Latest commit

 

History

History
95 lines (72 loc) · 3.33 KB

File metadata and controls

95 lines (72 loc) · 3.33 KB
title -Ox (Full Optimization) | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-tools
ms.tgt_pltfrm
ms.topic article
f1_keywords
VC.Project.VCCLCompilerTool.ToolOptimization
/ox
dev_langs
C++
helpviewer_keywords
Ox compiler option [C++]
fast code
/Ox compiler option [C++]
-Ox compiler option [C++]
full optimization
ms.assetid 3ad7c30b-c615-428c-b1d0-2e024f81c760
caps.latest.revision 13
author corob-msft
ms.author corob
manager ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

/Ox (Full Optimization)

The /Ox compiler option produces code that favors execution speed over smaller size.

Syntax

/Ox  

Remarks

Specifying the /Ox compiler option is the same as using the following options:

/Ox is mutually exclusive from:

The /Ox compiler option also enables the Named Return Value optimization, which eliminates the copy constructor and destructor of a stack based return value. For more information, see /O1, /O2 (Minimize Size, Maximize Speed).

You can cancel out the /Ox compiler option if you specify /Oxs, which combines the /Ox compiler option with /Os (Favor Small Code). The combined options favor smaller code size.

In general, specify /O2 (Maximize Speed) instead of /Ox, and /O1 (Minimize Size) instead of /Oxs.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Working with Project Properties.

  2. Click the C/C++ folder.

  3. Click the Optimization property page.

  4. Modify the Optimization property.

To set this compiler option programmatically

  • See xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.Optimization%2A.

See Also

/O Options (Optimize Code)
Compiler Options
Setting Compiler Options