This question and MSDN seem to imply that /O2 would be faster, but if you look at Microsoft's own SafeInt class, you will notice it says:
1) Compile optimized code -
/Ox
is best,/O2
also performs well. Interestingly,/O1
(optimize for size) does not work as well.
If the difference is truly just /GF /Gy
as the question above says, then /GF
is irrelevant (string pooling), and /Gy
(omitting frame pointers) can't really hurt you, as far as I imagine.
Is there something I'm missing? Is /Ox
faster in general? Why or why not?