什么是Visual Studio中的c ++编译器优化技术 [英] What are the c++ compiler optimization techniques in Visual studio

查看:485
本文介绍了什么是Visual Studio中的c ++编译器优化技术的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道编译器优化策略生成优化的目标代码为我的c ++应用程序在Visual studio。
目前我使用的是默认设置。

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.

推荐答案

简而言之: / O1和/ O2标志。他们设置优化以最小化大小或最大化速度。

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.

完整链接: http://social.msdn.microsoft.com/forums/en-us/vcgeneral/螺纹/ 8931B453-6B0D-46C6-B2C6-EE2BEA2FFB76

这篇关于什么是Visual Studio中的c ++编译器优化技术的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆