What’s the difference between the /Ot flag (“favor fast code”) and the /O2 flag (“maximize speed”)?
(Ditto with /Os and /O1.)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
/O1 and /O2 bundle together a number of options aimed at a larger goal. So /O1 makes a number of code generation choices that favour size; /O2 does the same thing and favours speed.
/O1 includes /Os as well as other options. /O2 includes /Ot as well as other options. Some optimisations are enabled by both /O1 and /O2. And, depending on your program’s paging behaviour, /O1 (size) can result in faster speed than /O2 if paging code comes to dominate your perf over instruction execution cost.
A good short summary of the impact of /O1 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