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

33 Comments

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

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

    But it's already four days gone.
    When will it come?

  • Hi Scott

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

    Ken

  • 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

  • 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?

  • 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.

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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???

  • 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.

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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?

  • 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

  • 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.

    :)

  • 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

  • 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.


  • Weird I use the properties grid all the time.

  • 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.

  • 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

  • What about support for editing SharePoint v3 sites?

  • 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

  • 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

  • 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

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

  • 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

Comments have been disabled for this content.