Skip to content

Commit d0a7f04

Browse files
author
Colin Robertson
committed
Rewrites for formatting and clarity
1 parent c0fa746 commit d0a7f04

File tree

2 files changed

+45
-60
lines changed

2 files changed

+45
-60
lines changed
Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "-O Options (Optimize Code) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "09/25/2017"
55
ms.reviewer: ""
66
ms.suite: ""
77
ms.technology:
@@ -22,47 +22,36 @@ caps.latest.revision: 11
2222
author: "corob-msft"
2323
ms.author: "corob"
2424
manager: "ghogen"
25-
translation.priority.ht:
26-
- "cs-cz"
27-
- "de-de"
28-
- "es-es"
29-
- "fr-fr"
30-
- "it-it"
31-
- "ja-jp"
32-
- "ko-kr"
33-
- "pl-pl"
34-
- "pt-br"
35-
- "ru-ru"
36-
- "tr-tr"
37-
- "zh-cn"
38-
- "zh-tw"
3925
---
4026
# /O Options (Optimize Code)
41-
The **/O** options control various optimizations that help you create code for maximum speed or minimum size.
42-
43-
- [/O1](../../build/reference/o1-o2-minimize-size-maximize-speed.md) optimizes code for minimum size.
44-
45-
- [/O2](../../build/reference/o1-o2-minimize-size-maximize-speed.md) optimizes code for maximum speed.
46-
47-
- [/Ob](../../build/reference/ob-inline-function-expansion.md) controls inline function expansion.
48-
49-
- [/Od](../../build/reference/od-disable-debug.md) disables optimization, speeding compilation and simplifying debugging.
50-
51-
- [/Og](../../build/reference/og-global-optimizations.md) enables global optimizations.
52-
53-
- [/Oi](../../build/reference/oi-generate-intrinsic-functions.md) generates intrinsic functions for appropriate function calls.
54-
55-
- [/Os](../../build/reference/os-ot-favor-small-code-favor-fast-code.md) tells the compiler to favor optimizations for size over optimizations for speed.
56-
57-
- [/Ot](../../build/reference/os-ot-favor-small-code-favor-fast-code.md) (a default setting) tells the compiler to favor optimizations for speed over optimizations for size.
58-
59-
- [/Ox](../../build/reference/ox-full-optimization.md) selects full optimization.
60-
61-
- [/Oy](../../build/reference/oy-frame-pointer-omission.md) suppresses the creation of frame pointers on the call stack for quicker function calls.
62-
63-
## Remarks
64-
You can also combine multiple **/O** options into a single option statement. For example, `/Odi` is the same as `/Od /Oi`.
65-
66-
## See Also
67-
[Compiler Options](../../build/reference/compiler-options.md)
68-
[Setting Compiler Options](../../build/reference/setting-compiler-options.md)
27+
28+
The **/O** options control various optimizations that help you create code for maximum speed or minimum size.
29+
30+
[/O1](../../build/reference/o1-o2-minimize-size-maximize-speed.md) sets a combination of optimizations that generate minimum size code.
31+
32+
- [/O2](../../build/reference/o1-o2-minimize-size-maximize-speed.md) sets a combination of optimizations that optimizes code for maximum speed.
33+
34+
- [/Ob](../../build/reference/ob-inline-function-expansion.md) controls inline function expansion.
35+
36+
- [/Od](../../build/reference/od-disable-debug.md) disables optimization, to speed compilation and simplify debugging.
37+
38+
- [/Og](../../build/reference/og-global-optimizations.md) enables global optimizations.
39+
40+
- [/Oi](../../build/reference/oi-generate-intrinsic-functions.md) generates intrinsic functions for appropriate function calls.
41+
42+
- [/Os](../../build/reference/os-ot-favor-small-code-favor-fast-code.md) tells the compiler to favor optimizations for size over optimizations for speed.
43+
44+
- [/Ot](../../build/reference/os-ot-favor-small-code-favor-fast-code.md) (a default setting) tells the compiler to favor optimizations for speed over optimizations for size.
45+
46+
- [/Ox](../../build/reference/ox-full-optimization.md) is a combination option that selects several of the optimizations with an emphasis on speed. It is a strict subset of the **/O2** optimizations.
47+
48+
- [/Oy](../../build/reference/oy-frame-pointer-omission.md) suppresses the creation of frame pointers on the call stack for quicker function calls.
49+
50+
## Remarks
51+
52+
You can combine multiple **/O** options into a single option statement. For example, **/Odi** is the same as **/Od /Oi**. Certain options are mutually exclusive and cause a compiler error if used together. See the individual **/O** options for more information.
53+
54+
## See Also
55+
56+
[Compiler Options](../../build/reference/compiler-options.md)
57+
[Setting Compiler Options](../../build/reference/setting-compiler-options.md)

docs/build/reference/o1-o2-minimize-size-maximize-speed.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "-O1, -O2 (Minimize Size, Maximize Speed) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "09/22/2017"
4+
ms.date: "09/25/2017"
55
ms.reviewer: ""
66
ms.suite: ""
77
ms.technology:
@@ -36,30 +36,29 @@ Selects a predefined set of options that affect the size and speed of generated
3636

3737
## Syntax
3838

39-
> /O1
39+
> /O1
4040
> /O2
4141
4242
## Remarks
4343

44-
The following table describes **/O1** and **/O2**.
44+
The **/O1** and **/O2** compiler options are a quick way to set several specific optimization options at once. The **/O1** option sets the individual optimization options that create the smallest code in the majority of cases. The **/O2** option sets the options that create the fastest code in the majority of cases. The **/O2** option is the default for release builds. This table shows the specific options that are set by **/O1** and **/O2**:
4545

46-
|Option|Equivalent to|Comment|
47-
|------------|-------------------|-------------|
48-
|**/O1** (Minimize Size)|**/Og /Os /Oy /Ob2 /Gs /GF /Gy**|Creates the smallest code in the majority of cases.|
49-
|**/O2** (Maximize Speed)|**/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy**|Creates the fastest code in the majority of cases. (default setting for release builds)|
46+
|Option|Equivalent to|
47+
|------------|-------------------|
48+
|**/O1** (Minimize Size)|[/Og](../../build/reference/og-global-optimizations.md) [/Os](../../build/reference/os-ot-favor-small-code-favor-fast-code.md) [/Oy](../../build/reference/oy-frame-pointer-omission.md) [/Ob2](../../build/reference/ob-inline-function-expansion.md) [/Gs](../../build/reference/gs-control-stack-checking-calls.md) [/GF](../../build/reference/gf-eliminate-duplicate-strings.md) [/Gy](../../build/reference/gy-enable-function-level-linking.md)|
49+
|**/O2** (Maximize Speed)|[/Og](../../build/reference/og-global-optimizations.md) [/Oi](../../build/reference/oi-generate-intrinsic-functions.md) [/Ot](../../build/reference/os-ot-favor-small-code-favor-fast-code.md) [/Oy](../../build/reference/oy-frame-pointer-omission.md) [/Ob2](../../build/reference/ob-inline-function-expansion.md) [/Gs](../../build/reference/gs-control-stack-checking-calls.md) [/GF](../../build/reference/gf-eliminate-duplicate-strings.md) [/Gy](../../build/reference/gy-enable-function-level-linking.md)|
5050

5151
**/O1** and **/O2** are mutually exclusive.
5252

53-
> [!NOTE] **x86 Specific**
53+
> [!NOTE]
54+
> **x86 Specific**
5455
> These options imply the use of the Frame-Pointer Omission ([/Oy](../../build/reference/oy-frame-pointer-omission.md)) option.
5556
5657
### To set this compiler option in the Visual Studio development environment
5758

5859
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
5960

60-
1. Click the **C/C++** folder.
61-
62-
1. Click the **Optimization** property page.
61+
1. Under **Configuration Properties**, open **C/C++** and then choose the **Optimization** property page.
6362

6463
1. Modify the **Optimization** property.
6564

@@ -69,10 +68,7 @@ The following table describes **/O1** and **/O2**.
6968

7069
## See Also
7170

72-
[/O Options (Optimize Code)](../../build/reference/o-options-optimize-code.md)
73-
74-
[Compiler Options](../../build/reference/compiler-options.md)
75-
76-
[Setting Compiler Options](../../build/reference/setting-compiler-options.md)
77-
71+
[/O Options (Optimize Code)](../../build/reference/o-options-optimize-code.md)
72+
[Compiler Options](../../build/reference/compiler-options.md)
73+
[Setting Compiler Options](../../build/reference/setting-compiler-options.md)
7874
[/EH (Exception Handling Model)](../../build/reference/eh-exception-handling-model.md)

0 commit comments

Comments
 (0)