I've been trying out Windows Live OneCare for around a month now and have generally liked it -- it's fast and simple (quite a contrast from my previous antivirus mega-suite).

Recently, I've noticed that Visual Studio 2005 has become dried-molasses slow. For example,

  • Opening files: 10 to 20 seconds
  • Saving files: 10 to 20 seconds
  • Closing files: about 30 seconds
  • "Close all Windows": Get a cup of coffee and watch The Daily Show on TIVO

Most of this time is taken by Windows Live OneCare (Disabling antivirus protection does speed up VS2005 but I don't want to disable my antivirus protection all of the time).  Strange.  And Windows Live OneCare doesn't seem to have any problems with other programs.  Also strange.

I googled for resolutions to the problem, but none of the suggestions seemed to help me (I don't use network shares for project storage, etc).  But I did find this post from Rick Strahl where, in the comments, he mentions that VS2005 performs quite a few file writes when saving -- this could affect any antivirus package (or in my case, OneCare).

The Rick Strahl post mentioned a few files that I don't have, so I downloaded SysInternal's FileMon utility and profiled a save and a close in VisualStudio 2005.  This is what I found:

  • When saving a file, VS2005 writes around 1MB of data (in a dozen or so writes) to the ntuser.dat.LOG file for my profile
  • When closing a file, VS2005 writes multiple times to the solution's .SUO file

All of these writes appear to be processed by OneCare's antivirus component -- which is consuming most of my time. Excluding these files from virus scanning should speed things up a bit while still protecting most of my computer from viruses.

Because OneCare only supports single file exclusions from antivirus protection (no wildcards or type exclusions), I consider myself lucky that there are really only two files being written multiple times.  I added both of these files to the excluded list (Windows Live OneCare -> View or change settings -> Antivirus -> Antivirus Exclusions...) and now

  • Opening files: 1 to 2 seconds
  • Saving files: <1 second
  • Closing files: <1 second
  • "Close all Windows": Thinking about getting a cup of coffee...

Much better!

Note that if you're working in multiple solutions, you will probably need to exclude the .SUO file for each solution -- I usually work in only one solution.