15

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 threaded? 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?

3
  • Do you use any VS plugins that might be consuming too many resources? Does your machine have sufficient RAM that as much as possible can be cached in RAM without swapping?
    – Mark Byers
    Apr 5, 2010 at 14:19
  • See also stackoverflow.com/questions/1814015/…
    – Brian
    Apr 5, 2010 at 14:37
  • I was wondering about the ram. this is a laptop with 2 cores and 3GB. Doesn't seem like much, but if the devenv.exe process is only using 700-900MB, do i need more? Apr 5, 2010 at 17:26

5 Answers 5

11

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.)

4
  • 1
    My VC++ 2008 build times went from 50 minutes down to 5 (with /MT) when I changed from a P4 HT to a new Core i7 Q at a lower clock speed (even with turbo boost). I know the processor wasn't the only part that improved, but I was still pretty impressed.
    – Michael Myers
    Apr 5, 2010 at 17:23
  • 1
    @mmyers: A build can be limited by disk IO, memory space, memory bandwidth or CPU --- and different ones at different times in the build. In general you want as much of all of them as is reasonably possible (i.e. budgets :-( apply). A specific build might be helped by one more than another, but the next project might be limited elsewhere.
    – Richard
    Apr 5, 2010 at 18:41
  • Yes, I agree. Judging from the CPU graphs, I think my bottleneck is now hard disk speed (both systems have 7200 RPM drives). So my next upgrade will be an SSD as soon as the good ones are affordable.
    – Michael Myers
    Apr 5, 2010 at 19:00
  • Yeah, Im looking into the SSD right now for my home machine, I've been hearing great things. Apr 6, 2010 at 12:38
5

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.

2

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...

1
  • 1
    I know I asked this question like 2 years ago, but I have since bought 3 SSDs and my build times are CRAZY fast. Oct 31, 2012 at 14:49
1

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

0

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.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.