Speed up Visual Studio

by: Steve Celius

Some tips and tricks I've picked up along the road. They might not give you a huge performance improvement, but the golden rule to disable or remove things you do not need, is always for the better. Do your own experiments and see if it helps. These screenshots are from Visual Studio 2008, but most of them should apply to Visual Studio 2005 too.

Turn off validation

Turn off validation

Has it ever helped you anyway? Use Firebug or the IE Developer Toolbar to help you validate your markup and CSS. How this feature ever ended up in Visual Studio is a mystery to me.

Turn off the Navigation Bar

This is the drop downs you see in the markup window and in the code behind source code view.

image

To fill those drop downs, Visual Studio needs to parse your markup and source code. In Visual Studio I have read that this parsing can take some time. When I look at a Web Form or Master Page it in Visual Studio 2008 it looks like the drop downs are not filled when the file opens, but when I click the controls themselves, which is an improvement. This is not the case for C# files. The context is shown as I move the caret around the code.

If you want to turn it off, remove the "Navigation bar" tick on both Html / General and C# / General.

image

For Visual Studio 2005 this should speed things up, for 2008 - I'm unsure. It will however save you some precious screen real estate, and that is always a good thing.

Show Live Semantic Errors

This is something that was added in the Visual Studio 2008 SP1 Beta, and as Scott puts it:

"The C# code editor now identifies and displays red squiggle errors for many semantic code issues that previously required an explicit compilation to identify.  For example, if you try to declare and use an unknown type in the C# code-editor today you won't see a compile error until you do a build.  Now with SP1 you'll see live red squiggle errors immediately (no explicit compile required)"

image

SP1 (Beta) for Visual Studio 2008 has focus on performance improvements, but I can never imagine this feature being especially easy on the system performance wise. I use Intellisense actively to avoid these kinds of errors in the first place (Ctrl+space is very useful), and won't waste any performance improvements in SP1 on this feature, so I turn it off:

image

Track changes

See the yellow line in this screenshot?

image

Seen it before? If not, you don't need it.

It indicates which parts of the file you have changed recently. But you are of course using Subversion and TortoiseSVN, so a quick diff in TortoiseSVN will give you the same result. If you need it. I sure don't need Visual Studio to tell me this, so I turn it off:

image

Animate environment tools

Ok, not a biggie, but I do not need windows to slide into view, just show them or keep'em hidden. I choose to turn this off:

image

Compile for the correct platform

I have seen this being mentioned several times, but unsure about the real effect it will have on your project. Some say it has a big effect, others are more reluctant. Try it yourself and see if it helps in your case.

image

As we're moving towards 64bit servers, this might actually give you headache down the road. It might be useful for local debug builds in your development environment though.

Speed up debugging by removing breakpoints

If you have many breakpoints lurking around your code, debugging in Visual Studio can be slow. Especially if you have conditional breakpoint rules (break if a value on a given object changes for an example). Remove all your breakpoints now an then:

image 

Formatting XML for easy diff

While we're at it, this is not a performance thing, but immensely useful never the less. Fredrik Haglund wrote a blog entry about this some time ago, and I'll add it here while I'm doing all these screenshots anyway. You can have Visual Studio format your web.config file (and all other xml files) to keep all attributes on separate lines, which is extremely helpful when you compare versions of the same file (using a diff tool).

image

Turn it on like this:

image 

Now - go tweak!

24 June 2008


Comments

  1. Great post Steve! Sometimes small changes make big difference, I will check how much those small changes will speed up my VS.
  2. Thanks!
  3. Nice summary. Reinstalling/upgrading VS often makes you forget these things.

    Let me make a couple of remarks though.

    1. "Live Semantic Errors" is my favorite Service Pack 1 feature - please don't turn it off until you've really tried it. For me, going back to Service Pack 0 felt almost like going back to Visual Studio 2005.

    2. With Visual Studio 2005, I once worked on a huge Web Application Project in a solution with ~20 Web Application and class projects. Time from F5 to "page loaded" was almost 30 seconds. I then tried moving as much as possible to a RAM drive: All code for all projects, the ASP.NET temporary files folder, anything else needed during compilation except for the .NET Framework itself and the Global Assembly Cache.

    The net result was, surprisingly, nothing. Nothing was sped up; time from F5 to "page loaded" was still 30 seconds. Using FileMon and RegMon to see what Visual Studio was doing during those 30 seconds showed that the compiler and the Global Assembly Cache in some way represented 95% of all time taken.

    GAC lookups and BCL DLL loading wasn't improved, and was apparently the only thing needing improvement.

    I plan to re-do this experiment using Visual Studio 2008 SP1 on Vista, and hope it yields a better outcome.

  4. Nice post, got some needed improvement in my dev. environment there :)
  5. alternatively you may try to save your breakpoints in a file, start your application and then reload breakpoints. the following site provides the required add in http://saurabhramya.googlepages.com/save&loadbreakpointsinvisualstudio
  6. Great post bud!
Post a comment    
User verification Image for user verification  
Steve Celius

About me

I work for EPiServer in Norway, mostly with technical stuff. Trying to keep up with all the new stuff from the development team. I also hang out on the EPiCode project, why don't you come join us?


Syndications


Archive


Tag cloud

EPiTrace logger