HTML Source Editing Performance Improvements in VS 2005 SP1

VS 2005 SP1 shipped on the web last week.  One of the overall goals with VS 2005 SP1 was to improve IDE performance and responsiveness for a number of common scenarios (a few examples: build times, managing large projects, refactoring, and intellisense). 

For web-scenarios, we specifically worked on the performance of the HTML source editor - especially with cases involving large HTML documents or slower machines.  Below are a few specific changes we made in SP1 to improve performance in this area:

1) We tuned the performance of the HTML Validation feature (to learn more about this feature read this old post of mine).  Validation of large documents now happens faster, and will not impact typing or updates as much (whereas previously validation would sometimes cause a slight stutter if you were typing in HTML source editing mode while the document was still in the process of validating).   

2) We fixed a scenario where if you turn off HTML validation, and then work on a page that has a bad HTML validation error, and then switch into WYSIWYG design mode, validation is automatically turned back on for you to help you identify the error.  While useful for debugging the error, a lot of people found this feature annoying since it meant that validation was continually being re-enabled without them realizing it (and on slow machines or with large documents this could slow down perf).  Now when you turn off validation, it will stay off.  If there is a blocking issue when you try to switch into WYSIWYG design mode, we will still identify the error for you, but we won't reenable validation for everything.

3) We added an option to optionally turn off using the property grid in HTML source editing mode.  In our performance profile samples we found that keeping the property grid updated with the correct HTML schema as you cursor throughout a document ended up taking a non-trivial amount of CPU time, and in talking with customers we found that a lot of people weren't taking advantage of this feature anyway (note: supporting the property grid in HTML source mode for server controls was a new feature with VS 2005 that didn't exist in VS 2003).  If you aren't using the feature, or are on a slow machine, then I'd recommend keeping this feature disabled.

Important Note If You Want Property Grid Support in HTML Source Editing Mode

As I mentioned above, with VS 2005 SP1 we now have the ability to configure whether the property grid is used or not while in HTML source editing mode.  Because the majority of developers we talked with weren't using this feature (most were not actually even aware that it existed <g>), we decided to make the default configuration with SP1 to have this feature disabled.  This means that when you are working in HTML source editing mode by default with SP1 you'll now see a property grid that looks like this:

If you want to re-enable the property grid in source mode so that it is dynamically updated as you cursor through the document, simply open the Tools->Options menu item and click the "Enable Property Grid in Source View" configuration option within the Text Editor->Html->Miscellaneous category:

You will then have the property grid re-enabled just like in the VS 2005 RTM release:

Please note that this setting has no impact on the property grid in HTML WYSIWYG design mode or on any other designer - the property grid is always enabled/displayed in those scenarios.  It only impacts HTML source editing mode (which we think is a much more rare scenario).

Hope this helps,

Scott

Published Tuesday, December 19, 2006 1:25 AM by ScottGu
Filed under: , ,

Comments

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 5:03 AM by Chris Field

Great tip - thanks. But why are Events still only available in Design mode? :(

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 7:28 AM by vikram

Yes ,

You are right about property grid issue in the HTML source. Most of the developers I know do not use it. Although I have been using it quite regularly

# Four days passed...waiting for vs2005 sp1 Update for Vista Beta

Tuesday, December 19, 2006 8:31 AM by sunboy~

"Visual Studio 2005 SP1 Update for Windows Vista Beta - COMING SOON"

But it's already four days gone.

When will it come?

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 9:01 AM by Kenneth

Hi Scott

A question: Why aren't events listed in the grid? Still have to switch to design mode to edit them.

Ken

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 9:05 AM by Sahil Malik

Scott,

I used to use that property editor in HTML View. Great, now you broke it. I'm gonna start a petition for SP2 now.

Okay just kidding - good work on SP1. Why does the install take so long though?

Sahil

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 9:18 AM by Mike

Going from Source to Design mode on large web forms still takes a long time. It looks like it goes thru every control on the page each time. Can you guys speed this up?

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 10:12 AM by Brendan

Are you thinking of ever adding events into the properties window while in the source view?

I always find it a pain when I want to quickly make a stub function and I can't in the source editor.

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 1:07 PM by ScottGu

Hi Andrew,

I believe that that issue is fixed with SP1.  I can't remember whether the code that causes the issue is VS or the .NET Framework (which has separate servicing patches). If the problem was in VS then the fix is included in SP1.

Thanks,

Scott

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 1:08 PM by ScottGu

Hi Boris,

The documentation for the full set of fixes will be coming soon - that is definitely something we are working on.  It will probably appear on the web in a summarized form in early January.

Thanks,

Scott

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 1:10 PM by ScottGu

Hi Chris/Kenneth/Brendan,

The events tab in source view is something we just added to the VS Orcas release.  You should start to see it appear in the VS Orcas CTPs starting in February.

Thanks,

Scott

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 1:13 PM by ScottGu

Hi Mike,

Switching from source to design-view does take longer than we'd like.  Part of this is because of the architecture (we have separate editors for source and design mode), and also partly because of the source-preservation logic that was added with VS 2005 (so that the HTML is no longer malformed on view-switches).

With VS "Orcas" we are actually introducing a new designer that stays running while in source mode and will enable a variety of really nice scenarios - including instantaneous view switching as well as split-view support (so you can have both the designer and html view open at the same time).  You should start to see this appear in the February CTP release.

VS Orcas supports targetting both ASP.NET Orcas as well as ASP.NET 2.0.  So you'll also be able to use it on your current projects, without having to upgrade framework versions (allowing you to take advantage of these features sooner).

Hope this helps,

Scott

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 2:39 PM by Josh Stodola

I love VS 2005.

I hate moving around different windows, like the Output window and error list.  When I attempt to move these around, tehre is at least a one second delay before the box appears to move.  I dont understand why my CPU has to be 100% allocated in order to move a tiny build output window 2 inches.  It's not just the delay it takes to recognize that I am trying to move something, but just moving it around in general is very laggy.

I never had this problem in 2003, so tell me what's up

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 2:46 PM by Mike

Great news....just one comment, though:

"..HTML source editing mode (which we think is a much more rare scenario)."

Rare???  What do you base this on???

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 2:48 PM by Steve Webber

I too and eagerly awaiting the opportunity to run VS2005 SP1 on Vista. Would like to know the expected availability so I can plan what to work on.

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 5:29 PM by Another Mike

Great tip, thanks!

I have been meaning to ask this question for a long time: is Visual Studio 2005 a .Net application?

Also, the Expression Web program from Microsoft was just released, was there no way of using the designer from that program in Visual Studio 2005? I believe it also has significant improvements, is it the same one as in Orcas?

-M

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 7:28 PM by ScottGu

Hi Mike,

I didn't mean to imply that source view is rare -- far from it (people use source view over design view more than 50% of the time).

What I said above was that using the property grid while in source view is much rarer (a lot of people don't even know this feature exists).  That is what we are making it configurable as to whether it is enabled.

Thanks,

Scott

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 9:24 PM by ScottGu

Hi Another Mike,

VS 2005 contains a substantial amount of managed .NET code - although the core shell itself is still native C++ code.

The HTML designer that ships in Expression Web designer is the same designer surface that will ship in VS Orcas.  It will be shared going forward between both programs.

Hope this helps,

Scott

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 9:26 PM by ScottGu

Hi Scott,

Can you send me an email regarding how you bring up the style editor in VS 2003?  I know there is still a style editor in VS 2005 - if you send me email with the details of how you are doing it today I can loop someone in to help explain how to use it.

Thanks,

Scott

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 19, 2006 9:27 PM by ScottGu

Hi Josh,

I haven't seen the 1 second pause you mentioned when moving the output window.  Does this pause happen only while you are building a project?

Thanks,

Scott

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Wednesday, December 20, 2006 5:54 PM by Nilesh Deshpande

Instead of enabling/disabling property grid (from Tools/Options menu), it would have been better if we could refresh Property grid by hitting F4 key, all other times keep it disabled.

Property grid useful to me to quickly set properties (STYLE, BACKGROUND) instead of typing them(using intellisense).

Thanks,

Nilesh

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Thursday, December 21, 2006 4:43 AM by dcuk7

Hi Scott,

Are you guys working out a way to keep the property grid without impacting performance too much for VS "Orcas" because I did use it quite a bit, especially for certain controls such as validation controls?

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Thursday, December 21, 2006 12:29 PM by ScottGu

Hi dcuk7,

You can definitely still use the property grid in source view even with VS 2005.  What we did above was to turn it off by default, but you can go into Tools->Options like I described above to re-activate it.

One reason we turned it off by default was that many of our customers have slower machines with low amounts of RAM - and we wanted to make sure VS performed well on them.  If you have a newer machine (less than 3 years old) you shouldn't have any problems with it enabled.

Hope this helps,

Scott

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, December 26, 2006 3:24 PM by John A. Davis

While installing (or thinking it's being installed) I had to leave my doors open all night, put a box fan on the computer, and sit there in a sleeping bag on the couch (very cold outside) so the install wouldn't cause my CPU to heat up and shut down. This is not your fault, CPU is only 2.4 Ghz. .. . .

But, HOW DO I TELL IF VS 2005 SP1 HAS BEEN INSTALLED? where do I look and what do I look for? I am no stranger to the "About" menu choice. I just don't see the word "SP1" anywhere and nothing looks any different.

:)

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Wednesday, December 27, 2006 9:26 PM by ScottGu

Hi John,

Here are two ways to tell if SP1 is installed:

1) Select the Help->About menu item and scroll down on the list of products to see if SP1 is listed.

2) Try doing a File->New Project and check to see if you can create a Web Application Project application.

Hope this helps,

Scott

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Thursday, December 28, 2006 4:59 AM by John Grant

I use the Property Grid in HTML Source Editing Mode extensively. I am surprised it is now disabled. I agree with Nilesh if it could be possible to refresh the Property Grid on demand by pressing F4.

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Friday, December 29, 2006 3:34 PM by Gary

Weird I use the properties grid all the time.

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Sunday, December 31, 2006 1:21 PM by Bostu

About Property grid issue in the HTML source editing mode - nearly all (about 110 developers) our developers use this feature. I think this feature is really helpful.

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Sunday, December 31, 2006 2:35 PM by ScottGu

Hi Bostu,

Don't worry - the feature isn't going away.  You can still definitely enable it using the tools->options setting above.

The only reason we turned it off by default was because we saw some developers on slower machines complaining about it impacting perf.  We still think it is a valuable feature.

Thanks,

Scott

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, January 2, 2007 2:28 PM by BobC

What about support for editing SharePoint v3 sites?

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, January 2, 2007 3:40 PM by ScottGu

Hi BobC,

The SP doesn't add editing support for SharePoint v2.0 sites.  But you can use this download to add support for creating, deploying and debugging web parts for SharePoint v3: http://www.microsoft.com/downloads/details.aspx?familyid=19F21E5E-B715-4F0C-B959-8C6DCBDC1057&displaylang=en

Hope this helps,

Scott

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, February 13, 2007 7:39 AM by Eti

Hi Scott

All my usercontrols no longer have accessible properties after updating to sp1! The property pages are blank, and code that said "UserControl1.Visible" now throw exceptions?!?

Any ideas?

Thanks

Eti

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Tuesday, February 13, 2007 9:53 AM by ScottGu

Hi Eti,

Can you send me an email with more details about ths?  Are you seeing the property page blank in source mode or in WYWISYG design mode?  Once you send me email I can get someone on the team to help.

Thanks,

Scott

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Wednesday, March 14, 2007 7:47 AM by Since installing SP1 property pages blank in source mode

Scott,

I'm getting behaviour in VS2005 where the property  pages are blank when in source mode.. this is happening for ALL controls...

PJ

# re: HTML Source Editing Performance Improvements in VS 2005 SP1

Friday, March 16, 2007 2:36 AM by ScottGu

Hi PJ,

The article above describes how to enable the property pages in source mode after SP1 has been installed.

By default the property grid is disabled unless you go into tools->options and enable it.

Hope this helps,

Scott