Coffee and Code

The Life and Times of Jeff Woodman

Home >> For Performance Issues, Firebug Rocks

For Performance Issues, Firebug Rocks

Posted: 03/20/2008 01:05 PM | permaLink | Comment on this entry!

Tags: development asp.net firebug tools

Firebug!
Do you want real, ultimate, client-side debugging power? Get Firebug today.

This week I tackled some performance issues with my new weblog. I had noticed that the weblog took an awfully long time to load. So, I navigated to my weblog and launched Firebug. Firebug's network monitor quickly informed me that:

  • The request to the weblog page itself was averaging over 1 second in duration.
  • The size of the HTML response for the page was in excess of 50 Kb.
  • AJAX resources and Script.aculo.us libraries were unneccessarily loaded on every request - these are only needed in an authenticated context.

Damn, I loves me some Firebug!

Using this information, I determined that the ViewState (A hidden form tag on the page) content was sometimes as large as 23 Kb! In other words, the ViewState information accounted for almost 50% of the markup on the page.

Some minor code changes resulted in a HUGE reduction in the ViewState size. For one particular weblog entry, the viewstate was reduced from 23552 bytes to 236 bytes - a 98.99% difference!

In addition to the viewstate optimizations, I also did the following:

  • Reduced the total number of items that are fetched for each request to the page - From 17 to 5, on average.
  • Implemented caching where I could to reduce round-trips to the database (From 7 round-trips to 1 round-trip per request).
  • Replaced the Archive TreeView with a simple repeater. The TreeView is expensive to initialize and populate server side, and emits tables which are a Web 2.0 no-no in most cases.

If you're a web developer, Firebug will make your life easier. For ASP.Net developers, I also recommend Binary Fortress's ViewState Helper for Internet Explorer - This tool will decode viewstate for you so you can examine the contents, as well as giving you the ViewState size and percentage of the page's content that the ViewState consumes.

Post A Comment


 


 

Comment: