Teched 09: Day #2 part 2

Microsoft Tech.Ed just asked a lot of a human body, leaving mine sick at home for a whole week.
I finally found some time to complete the rest of my report on this big event.

Building high performance web apps

Tips and Tricks for Building High Performance Web Applications and Sites (Giorgio Sardo)

The title of this session covers the content completely.
The first item Giorgio Sardo wanted to show, is what determines the performance of websites in IE.
I have always thought that the big performance issues were caused by JS/DOM-operations,
but thes operations only cause 33% of the CPU-load.
67% procent is caused by Layout, Rendering, Formatting,… of a web page.

Performance tricks were divided into 5 categories:

1. CSS performance

Unused styles cause performance problems. The speaker demonstrates a  bookmarklet to find styles that are included, but not used on a web page.
It is also good to replace dependency selectors (i.e. ul li) to child selectors (ul > li)

2. Optimizing symbol resolution

  • Avoid global variables.

3. Javascript coding inefficiencies

  • Minimize DOM interaction, because this is very expensive.

IE 8 developer tools now offers a profiler to view the performance of your JavaScript,
this seems to be a very usefull tool.

4. HTTP performance

  • Use HTTP compression, this can be configured in IIS 7 (option enable static content compression).
  • Combine images in sprites, using SpriteMe.
  • Make use of Doloto: this new application from MS DevLabs creates a tree of your navigation to each single function in your application.
  • Put your javascript includes at the end of the HTML-page, so the browser can already load the page before loading the javascript files.

5. Layout Performance

  • Use Expression SuperPreview to see how pages are rendered in different browsers.
  • Another usefull tool is Fiddler.

What’s New in Microsoft ASP.NET Model-View-Controller (Stephen Walther)

Stephen Walther is an excellent speaker, showing some great demos in this session.

  • In ASP.NET MVC 2.0 there is a “better separation of concerns”: Use RenderAction to invoke a controller action.
    RenderPartial() in MVC 1.0 only generates the UI, RenderAction() invokes a controller action before rendering the UI.
  • Areas are introduced: some kind of mini-applications integrated in a big application (i.e. admin section)
  • Model validation: decorate model classes for validation (this looks very similar to .NET WCF Ria Services).
  • Templating is also improved.