For several weeks now I’ve been suffering a slow painful agony at work, Visual Studio 2010 has been unusably slow. The editor takes forever to display WPF views and don’t even get me started on builds. I’ve got what I would consider to be a pretty decent pooter – Alienware M17xR3 with an Intel i7-2720QM 2.2Ghz, 16GB ram with SSD drives. The machine is still generally pretty quick. It boots in a matter of seconds. A quick test of the disks using CrystalDiskMark shows that disks are running within the expected ranges.
Visual Studio seems to be the only thing really running slowly
I tried the usual suspects. Disabling all plugins and addins. ReSharper is a very powerful tool – but it can also come with a cost creating all of its metadata. It was conceivable that as our solution grew (it’s at 40+ projects) some bug may have been exposed in R#. I also disabled Intellitrace and various other things that were rumored to help deal with slowness.
There’s no bad ideas when you’re brainstorming
That header there was for those of you with toddlers and TV’s glued to the Disney channel. Yes, its true… I have kids TV show songs like Imagination Movers stuck in my head most o f the time now. Oh the joys of being a parent =) In all seriousness though after sitting back and thinking about the systems involved it dawned on me. Real time anti-virus scanning. Visual Studio is constantly writing temporary files during use. Builds are especially disk intensive. Builds are also usually building and copying around exes and dlls that real time anti-virus engines love to scan. This may not be immediately apparent on smaller solutions which would explain why this seems to have been a progressing problem. As more and more code and projects were added to the solution – Visual Studio got slower and slower. To test this theory I just disabled AVG and ran a build. Hurray it was fast again!
Add some scanning exceptions
Thankfully due to our strict rules on source control all of our solutions exist within one of two folders – one for SourceGear Vault and one for TFS. This allowed me to create a handful of exceptions under the AVG real-time scanner settings that excluded my source control repositories. Suddenly now my designers as well as my builds are quick once more!
Set it and forget it is great – except when you set something up years ago and forget about it when its causing you problems. =)