views:

400

answers:

5

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 pretty minimal software environment.

Edit: Martin and jdehaan pointed out that MP is not incompatible with precompiled headers. Details are here.

+3  A: 

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)

Martin Beckett
You're right, the pch should make no problems. It is created in a first non MP step and used read-only during the whole build for each compilation unit.
jdehaan
Thanks for clarifying that. I read http://msdn.microsoft.com/en-us/library/bb385193.aspx again and noticed this time that MP is incompatible with creating the pch, not with using it. So Martin and jdehaan are absolutely correct.
criddell
+1  A: 

Are you using precompiled headers? Do your libraries change between builds? Are you rebuilding anything more often than is necessary?

Guy
+1  A: 

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.

MSalters
+1  A: 

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.

Chris O
+1  A: 

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.

Iulian Şerbănoiu
35 minutes using IncrediBuild? How long did builds take without it?
criddell
35 minutes without IncrediBuild. With incredibuild (with 15-20 computers used) it took around 5-6 minutes (which is 7 times faster). I edited the answer to be more clear.
Iulian Şerbănoiu