Reputation: 764
I am currently involved in a ASP.NET project with about 40 projects in the solution. We are doing all our development in cloned Virtual PC environments so all developers have identical setups. That's all good, managing dependencies is easy, however building the solution is horribly slow. Virtual PC can only utilize one CPU so I'm really only using half of my computers resources.
It takes a full 3 minutes from build to a complete page load.. and it's getting worse every day as the projects grow. Fixing simple things is starting to take a long time and personally, I'm getting frustrated waiting all the time as I can't really work while the computer is compiling.
Is there any way of distributing my build across several computers to speed up the build process?
Would an SSD noticeably improve upon my build times?
Are there any other way of speeding up the build?
Note: I have tried precompiling static dependencies with ngen but later read that ASP.NET does not support ngen. I use Visual Studio 2008 and there is no antivirus software present in the virtual environment.
Upvotes: 14
Views: 12452
Reputation: 5447
And here is another tip to speed up build times with ASP.NET:
Upvotes: 4
Reputation: 5447
You can greatly reduce the time you wait for a build with ASP.NET by doing the following:
Upvotes: 8
Reputation: 1413
What we did at our company is to use file reference, so only the changed projects need to be built, and at any given time there is no more than 10 projects in my solution, mostly 2~3 gets built.
We also build our trunk for each check-in, and have batch file for developers to pull the most recent dlls.
Of course, this doesn't stop the painful assembly reference error from happening, but they become more of a nuisance than problem after a while.
Upvotes: 1
Reputation: 8381
Do not put so many projects in your solutions. Only create a new project when the code is run in a different process or on a different machine. There is no use to create so many projects in most cases. The number of projects is the most significant slow down in msbuild.
Upvotes: 1
Reputation: 161821
You might also consider switching to VMware Workstation, which does utilize multiple processors. I'm currently using a setup with two two-processor VMs, and all four do get used.
Upvotes: 1
Reputation: 4378
Have you tried tuning up virtual PC?
http://www.windowsnetworking.com/articles_tutorials/Tuning-Virtual-PC-Performance.html
Old article but the gist is still correct.
I found, in a similar situation, that having a separate hard disk for the VPC disk images sped up performance remarkably especially when removing some of the throttling.
Maybe the problem isn't Visual Studio, it's just the fact that compilation is resource intensive.
Upvotes: 0
Reputation: 44939
Scott Gu has an fairly helpful post about this:
Tip/Trick: Optimizing ASP.NET 2.0 Web Project Build Performance with VS 2005
Scott also has another article on the speed of this Hard Disk, which also has an impact on the general performance of Visual Studio:
Tip/Trick: Hard Drive Speed and Visual Studio Performance
Upvotes: 2
Reputation: 46475
We have a similar situation, and I found that our virtual machines were being heavily throttled, and so although they each ran on a single CPU, they weren't allowed to fully utilise that CPU. I managed to get 3 virtuals running on one physical to all perform 100% faster.
I'd also look at trying to reduce your number of projects. Our main solutions has 40 projefts, and I've been slowly consolidating these, and making sure new development fits in to existing projects where possible. The main culprits for this were webservices, where each had originally been created in a separate project. I am now adding all new webservices into a single project, and slowly moving the others across.
Upvotes: 1
Reputation: 17281
You didn't mention your Visual Studio version, but if it's 2005 you might want to consider an upgrade to 2008. In my case this decreased build time on a largish (30+ projects) solution.
Another option it to pre-build a number of libraries that do not change anymore and reference the compiled dll's in stead of the projects.
Upvotes: 1
Reputation: 44308
Do you need to rebuild all 40 projects every time.
You can configure what gets built in the Solution Configuration settings.
I.e. if you're changes are only in your WebUI Project, and the other 39 projects are unchanged, you can create a build configuration where only your web application is rebuilt.
Upvotes: 4