Optimize
#pragma optimize ("[optimization-list]", {on | off})
Feature only in Professional and Enterprise Edition Code optimization are supported only in Visual C + + Professional and Enterprise Editions. For more information, see Visual C + + Editions.
Specifies optimizations to is performed on a function-by-function basis. The optimize pragma must appear outside a function and takes effect at the first function defined after the pragma are seen . The on and off arguments turn options specified in the Optimization-list on or off.
The optimization-list can is zero or more of the parameters shown in Table 2.2.
Table 2.2 Parameters of the Optimize Pragma
Parameter (s) Type of optimization
A assume no aliasing.
G Enable global Optimizations.
P Improve floating-point consistency.
S or T specify short or fast sequences of machine code.
W assume no aliasing across function calls.
Y Generate Frame pointers on the program stack.
These is the same letters used with the/o compiler options. For example,
#pragma optimize ("ATP", ON)
Using the optimize pragma with the empty string ("") is a special form of the directive. It either turns off all optimizations or restores them to their original (or default) settings.
#pragma optimize ("", off)
.
.
.
#pragma optimize ("", ON)
How C + + release compiles when a piece of code is not optimized