8

Can you please advice how I can speed up a compiling, loading big solution (~50 projects). I mean only VS 2012 studio or Windows settings, not hardware changes.

Thanks

Alexandr
  • 1,452
  • 2
  • 20
  • 42

2 Answers2

7

Consider your need for 50 projects in one solution - having many projects that are referenced by each other is one of the main reasons for slowdowns.

One of the few valid reasons to have separate projects is because you need to deploy the generated assemblies separately. If this is not the case, consider combining projects - use folders for the logical separation.

The lower the number of projects, the faster your build will become.

In addition, if you change the builds to output to a specific shared directory and reference the DLLs instead of the projects, the number of unneeded re-compilations should go down drastically, though you will have to manage the build order yourself.

Oded
  • 489,969
  • 99
  • 883
  • 1,009
5

I use 100+ projects in a solution with Visual Studio 2012 Update 3, and it builds fast.

  1. I agree with shared output directory comment by Oded, but I'd like to mention that project references work OK too.
  2. Make sure that your \Users\\AppData\Local\Microsoft\WebsiteCache folder is empty. Somehow, this is a problem even with desktop-only solutions.
  3. I have disabled Productivity Power Tools 2012, since they compile code in the background, a bit too much for my liking. Disable all plug-ins and extensions and see if it makes any difference.
  4. Suppress excessive output messages to disk and to screen by reducing output verbosity Build-n-run
  5. Use multicore with MSBuild.
  6. As you code, try to limit dependencies between projects by using interfaces and abstract classes (C#).
  7. Try fresh *.suo and fresh *.sdf files. (Make a backup of the user settings and DB, then remove them and try building again)
  8. When all else fails, use ProcessMonitor or attach with another instance of Visual Studio to profile your Visual Studio while it's building.
  9. Try excluding file system filters, such as antivirus, from your build. For example, some antiviruses have a way of skipping scanning in certain directories or by file names.
GregC
  • 7,737
  • 2
  • 53
  • 67
  • How long does it take to build your solution of 100+ projects? Does it have C# only projects? Native C/C++? Managed C++? – Fede Aug 14 '14 at 03:06
  • 1
    All projects build in under six minutes, and relink in under two minutes. Native builds noticeably slower. We are mostly C#. F# projects build a little slower, but not so bad that I'd notice. We have home-bred code gen tools that take up most of build time. – GregC Aug 14 '14 at 16:32