/ O1 and / O 2 combine a number of options aimed at achieving a broader goal. So / O1 makes several code generation options that prefer size; / O 2 does the same and promotes speed.
/ O1 includes / Os, as well as other options. / O 2 includes / Ot, as well as other options. Some optimizations include both / O 1 and O2. And, depending on your paging behavior in your program, / O 1 (size) can lead to faster speeds than / O 2 if the paging code dominates your instruction execution cost.
A good summary of the effects of / O 1 and / O2 in VC ++ 2010 is here
http://msdn.microsoft.com/en-us/library/8f8h5cxt.aspx
and includes links for other versions of VC.
Martyn
Martyn lovell
source share