开发者

Will more CPUs/cores help with VS.NET build times?

I was wondering if anyone knew whether Visual Studio .NET had a parallel build process or not? I have a solution with lots of projects, every project has lots of markup/code, lots of types, etc. Just sitting there with intellisense on runs it up to about 700MB. But the build times are really slow and only seem to max out one of my two cpu cores.

Does this mean the build process is single threade开发者_JS百科d? My solution's build dependency chain isn't linear, so I don't see why it couldn't be building some of the projects in parallel. I remember Joel Spolsky blogging about his new SSD, and how it didn't help with compile times, but he didn't mention which compiler he was using. We're using VS 2005. Anyone know how it's compilation works? And is it any different/better in 2008/2010?

EDIT: Lots of good responses, here, but I'm interested specifically in C# and ASP.NET. No love for us web folks?


MSBuild (which VS uses to do builds, from 2005/.NET2) supports parallel builds. By default VS will set the maximum degree of parallelism to your number of processors. Use Tools | Options | Projects and Solutions | Build and Run to override this default.

Of course any one build might have more limited (or no) capacity to allow parallel builds. E.g. only one assembly in a solution provides no scope to build in parallel. Equally a large number of assemblies with lots of dependencies might block parallelism (A depends on B, C depends on A&B, D depends on C has no scope for parallel builds).

(NB. for C++, in VS 2005 & 2008 uses its own build system, in 2010 C++ will also be built with MSBuild.)


Scott Hanselman has a blog post from a couple years ago that details getting Faster Builds with MSBuild using Parallel Builds and Multicore CPUs that should be of interest. He also has a follow up post Hack: Parallel MSBuilds from within the Visual Studio IDE.


I would suggest that an SSD drive would provide the biggest benefit explicitly for builds

SuperUser which also refutes Joel's article

SO asking for best laptop etc: discussions on SSDs, cores, how VS works etc

Qualifier: I bought an Intel SSD for home use a month or 3 ago. Lordy it's fast and arguably the best piece of kit I've ever bought except for my Voodoo 2...


With VS2k5 it depends on which language you're trying to use. C/C++ has 'experimental' support for multi-threaded building, but this feature isn't officially supported until 2k8 using the /m: switch


I have used parallel builds in Visual Studio 2008. It does speed things up, but has many annoying side effects.

I often get failed builds not because some compilation failed but because VS was unable to write into a locked symbol database. I have also got really messed up Intellisense results. Sometimes I have to repeat the build two or three times to get a final success.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜