您的位置:首页 > 其它

如何提高vs2010编译速度?

2013-05-22 20:57 363 查看
如果你的cpu够强你应该学会如何利用好它来加速你的代码编译速度,那么你怎么才能够最大限度让你的cpu发烧呢?

下面是一个对比:

比如我的cpu是i7 3770k,

编译cocos2d-x的libcocos2d工程:

不优化:

1>Time Elapsed 00:01:35.25

优化后:

1>Time Elapsed 00:00:21.66

效果显著!!!

参考网页:

Visual Studio 2010中C++并行构建调优(1)
http://developer.51cto.com/art/201003/189235.htm
1>cl : Command line warning D9030: '/Gm' is incompatible with multiprocessing; ignoring /MP switch

解决办法是:

Properties -> Configuration Properties -> C/C++ -> Code Generation -> Enable Minimal Rebuild -> No(/Gm-)

Properties -> Configuration Properties -> C/C++ -> Geneal -> Multi-processor Compilation -> Yes(/MP)

一些含义和拓展资料:

Enable minimal rebuild

通过保存关联信息到.IDB文件,使编译器只对最新类定义改动过的源文件进行重编译,提高编译速度

Enable Incremental Compilation

同样通过.IDB文件保存的信息,只重编译最新改动过的函数

/MP (Build with Multiple Processes)

http://msdn.microsoft.com/en-us/library/bb385193.aspx

/Gm (Enable Minimal Rebuild)

http://msdn.microsoft.com/en-us/library/kfz8ad09.aspx
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: