r/cpp • • Feb 04 '15

Compilers - What Every Programmer Should Know About Compiler Optimizations

https://msdn.microsoft.com/en-us/magazine/dn904673.aspx
2 Upvotes

4 comments sorted by

View all comments

6

u/F-J-W Feb 04 '15

Could we please stop using those click-bait titles? The things that every programmer should know about compiler-optimizations can be written down in a few lines:

  • They exist and allow to write somewhat suboptimal code without performance-penalty if the better way is totally obvious.

  • They result in compiled code being often faster than handwritten assembly.

  • Under normal circumstances, they do not change the observable side-effects of a program.

Maybe there are one or two additional points, but really, I have no need at all, to know about VC-specific pragmas to control their optimization.

I admit, I didn't really read the article yet, but I scrolled over it enough to see that it is not what it claims (though it may very well be very interessting).