如何提高 VS2010/VS2012 编译速度

除了合理的划分模块,减少link的时间外,充分利用多核编译也很重要。

VS2010/2012都可以用多核编译,需要同时设置如下两个参数:

Enable Minimal Rebuild 

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

默认情况下该参数在Debug模式下为Yes,而在Release下为No。

 

Multi-processor Compilation

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

默认情况下Debug/Release均未设置。

 

在全局参数中可以设置最大并行project的数目。默认情况下该参数有系统的“核”数决定。如i7 CPU默认为8。

Options->Projects and Solutions->Build and Run:

8 maximum number of parallel project builds.

VS 编译速度 提高

分享到:
评论加载中,请稍后...
创APP如搭积木 - 创意无限,梦想即时!
回到顶部