Dramatically improving Visual Studio 2010 build times
After a year of trying to seriously improve Visual Studio 2010 I can finally say I’ve hit a major breakthrough.
First off, a bit of background. Visual Studio 2010 is not particularly slow. It’s in fact pretty good compared to the previous versions. However, when you start adding the projects requirements to Visual Studio (DevExpress, Telerik and other components), you’re in for a slow ride to hell.
We’re not going to discuss how to partition your code in multiple projects or solutions here, nor are we going to discuss the magic in the settings. There is enough info on the web about those. This actually works a lot simpler.
The strategy here is to use a RAM Disk for your solution, prevent Windows Search indexing at specific spots and apply other minor tweaks.
On with the statistics:
The Solution I had to work with was a 14 projects WPF app, using different libs and a gezillion lines of codes.
The hardware is a Dell XPS 1645 with an Intel i7-820QM (1.73 GHZ) 8 GB of DDR3 SDRAM, 256 GB SSD (Samsung).
You would think that you can throw anything at it right? Well not really.
- Full Build from the SSD Drive - 61 seconds
- Same Build from the RAM Disk - 34 seconds
It halved the build time. Opening XAML files is also halved and searching through files (by filename or content) is also twice as fast.
61 seconds might not seem like a lot to start with. But if you’re a front-end developer, you’re basically changing, running, changing, running etc. You don’t get nearly as much goodies than when writing C# and you’re constantly testing resolutions, data bindings etc.
On with the technique:
- We install this free RAM Disk software: Dataram Ramdisk
- Set up a RAM Disk of about double your Solution size (I went for 1024MB)
- Create a folder in the new RAM Disk and do a full SVN check-out (or git, …)
- Work, Build and Run from there.
If you commit often you should have no worries. Dataram Ramdisk has a nice option that saves the content of the RAM Disk back to the drive at shutdown and reloads it at startup. I confirms this works really well. However this doesn’t cover you from loss of power. Because my laptop is always connected, I take out the battery. So as far as I’m concerned, it’s as good as a desktop machine if the power cuts out. That’s only happened once in a year time and it was a junior tester that pulled the plug…
There are a few articles out there that claim that in modern computers, RAM Disk have no effect. They claim Windows’ Prefetch and Superfetch automatically will put in RAM the goodies. It’s my personal experience that they’re wrong. Sure, this won’t help for small projects. But if you have a decent size project, most of the time VS2010 is gone in la la land doing I/O. The cpu fluctuates from 100% to nothing while the HDD is suffering. It’s also my personal experience that SSD is good, but RAM Disks just beats it hands down. Especially in my case, with DDR3 and a fairly well designed bus.
Other minor techniques used include removing indexing (search for “indexing options” in the Start Menu) for key folders. That shred another 3 seconds off the total build time. Also make sure you disable the indexing of the ram disk.
Finally, you can change your Windows’ TEMP directory to point to a folder on the RAM Disk. That again will remove strain on the HDD because during build time, VS2010 seems to hit the TEMP folder a lot.
To further improve you build time and general experience, make sure to run the “Resource Monitor” from Windows and tick the box next to devenv.exe sort by total I/O descending. Once you’re doing your work you will see exactly what your HDD is doing.
Finally, build time is just like commute time between home and work. The shorter the better. Nobody likes waiting in front a computer chugging away. By the time the app launches, you forgot what you were doing.
HTH.
Related Posts
- M studio
- How to reduce your PSD files size using Photoshop
- Dekoh: share your desktop online
- Use Applications Full Screen in OS X Leopard (Hide the menubar)
- Spectra - Awesome 3d news reader, but very beta!

Stay focussed
Del.icio.us
Reddit
Stumble it
Digg it


Dominic Jodoin Says:
June 7th, 2011 at 10:28 amHey Nicolas!
Nice post! I’m really eager to try this at work.
Question: When you say “Set up a RAM Disk of about double your Solution size”. Do you mean double the size of only the vcproj’s and sln’s or these in addition with all the obj, pdb, dll, exe (i.e. binaries)?
Thanks!
Nicolas Noben Says:
June 7th, 2011 at 10:30 am@Dominic - I used twice the size of the whole solution folder. It’s excessive really. 750MB would also do it nicely.