What are the c++ compiler optimization techniques in Visual studio [closed]

只愿长相守 提交于 2019-12-12 10:38:40

问题


I want to know compiler optimization strategies for generating optimized object code for my c++ app in Visual studio. Currently i am using default settings.


回答1:


In short: the main things you would want to play around with are the /O1 and /O2 flags. They set the optimization to either minimize size or maximize speed.

There are a bunch of other settings but you don't really want to be playing around with these unless you really know what you are done and have already measured, profiled and figured out that changing compiler settings is the best way to get better perf or smaller size.

Full link at: http://social.msdn.microsoft.com/forums/en-us/vcgeneral/thread/8931B453-6B0D-46C6-B2C6-EE2BEA2FFB76




回答2:


Read the documentation available at:

msdn.com

http://msdn.microsoft.com/en-us/library/59a3b321.aspx
http://msdn.microsoft.com/en-us/magazine/cc163855.aspx
http://msdn.microsoft.com/en-us/library/aa290055%28VS.71%29.aspx
http://social.msdn.microsoft.com/Search/en-US?query=compiler%20optimization&ac=1




回答3:


a whole lot of them:
http://en.wikipedia.org/wiki/Optimizing_compiler
http://llvm.org/docs/Passes.html
those are academical techniques so they are transverse to any compiler. You can excpect most to be in visual studio.



来源:https://stackoverflow.com/questions/3538168/what-are-the-c-compiler-optimization-techniques-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!