3 ms·
The problem is you need to know exactly which optimisations are in the compiler, and whether or not your code will trigger those optimisations. This is very mu
by TheOtherHobbes 10y ago
The problem is you need to know exactly which optimisations are in the compiler, and whether or not your code will trigger those optimisations.
This is very much not a trivial requirement. If you're not desperate to optimise performance you can ignore it. But if you are, you really need to know in detail what your compiler will and won't do for you.
A blanket assumption that it's smarter than you will be wrong a significant proportion of the time.
- conistonwater 10y agoRight! And if you did do that, then the correctness of your code would depend on compiler version (to make sure that the expected optimizations will be triggered), which is one hell of a nontrivial dependency.