并行编译Parallel Building

对于大项目或则平台来说,并行编译可以节省很多时间,特别是在修改->编译->测试->再修改->再编译->再测试....->发布这些过程中.
以前做的一个项目要等30m+的编译时间(当然和开发者的机器性能也有关),还好当时有很多在机器编译不同的项目.不然从早到晚都要不停的编译.
 
现在我们有更好的办法:
 
Building Multiple Projects in Parallel
 

MSBuild 3.5 includes two ways to optimize build performance on multi-core or multiple processor systems, as follows:

  • By using the /maxcpucount switch on the command line.

  • By using the BuildInParallel task parameter on the MSBuild task.

在发布时,一般都要编译好几个版本,如debug,release或则check版本. /nodeReuse:<parameters> 开关可以帮助在编译release版后为编译debug或其他版本节省时间.

例如下面的在8cores上编译时任务管理器:

Reference:

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

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

原文地址:https://www.cnblogs.com/zzj8704/p/1728914.html