Search code examples
msbuildvisual-c++devenv

msbuild slower than devenv


I'm experiencing performance inconsistencies with regards to build duration when building a VS2008 solution file with either devenv or msbuild from command line.

My solution contains both C# and C++ projects, and I have these results:

devenv.exe (either command line or within the ide): 7 minutes msbuild.exe: 14 minutes

I tried tuning the msbuild switches passing /maxcpucount and /p:VCBuildAdditionalOptions=m# but with no luck so far.

Any idea?


Solution

  • MSBuild can be slower on VC projects. It does some gymnastics to build them, because they're not MSBuild format, and can't get much parallelism. Instead, try running VS on the command line- devenv.exe /build - if you need the performance. Or, upgrade to VS2010, because VC projects are natively built by MSBuild and you will get your performance back. It will typially be faster than VS.

    Of course, the killer way to get build speed is to build only what has changed, and rely on incremental build. Most of the time, most developers should be doing quick incremental builds.

    Dan