Multi-process builds in Visual Studio 2010: Worth it?
I've started testing our C++ software with VS2010 and the build times are really bad (30-45 minutes, about double the VS2005 times). I've been reading about the /MP switch for multi-process compilation. Unfortunately, it is incompatible with some features that we use quite a bit like #import, incremental compilation, and precompiled headers.
Have you had a similar project where you tried the /MP switch after turning off things like precompiled headers? Did you get faster builds?
My machine is running 64-bit Windows 7 on a 4 core machine with 4 GB of RAM and a fast SSD storage. Virus scanner disabled and a 开发者_Python百科pretty minimal software environment.
Edit: Martin and jdehaan pointed out that MP is not incompatible with precompiled headers. Details are here.
Are you sure that pch is incompatible with /MP?
You could certainly do a multi-core build on vs2008 with pch (although oddly only from within the IDE not on the commandline)
Definitely YES. I worked on a large application which took around 35 minutes to build when something was modified (In Visual Studio). We used IncrediBuild for that (to speed up the compilation process, from 35 minutes to 5 minutes) - to be truly distributed. In your case it is possible that /MP switch will make some difference - but not that much compared to distcc (unix or compatible environment) or IncrediBuild.
My own experience is with VS2005 and VS2008. With both of these, we turn off parallel builds since it doesn't work reliably for our large projects. Also with both, enabling PCH gives great performance benefits. Though if you don't use PCH with VS2008, you can really bad compile times as compared with VS2005. I don't know how much of this is relevant to VS2010 though.
EDIT: Had same problems with VS2010... but then we upgraded from WinXP to Win7 and all of our Visual Studio problems went away, with respect to both stability and performance. In my previous ansswer, the parallel builds refers to msbuild project parallelism, and "large" in this case instead referred to large solutions.
Multi-machine builds (with IncrediBuild) were worth it for us. So a multi-process build on a single machine is quite likely to be worth it.
精彩评论