spam poison

Optimising Performance

This acticle in other languages: Russian

There are several measures you can take to improve the performance of IE7 on your site. They are listed (roughly) in order of importance.


There are several measures you can take to improve the performance of IE7 on your site. They are listed (roughly) in order of importance.

Standards Mode

Include a DOCTYPE as the very first line of your HTML page to ensure that IE is in standards mode. This will improve performance in IE6.

Efficient CSS

I’ve recently seen several articles about writing efficient CSS. These articles usually describe how to use shorthand CSS properties to minimise file size. This is not the kind of efficiency I’m about to describe. IE7 includes a CSS query engine to implement CSS2 selectors. Because IE7 is written in an interpreted language (approximately 100 times slower than a compiled language) the CSS engine is noticeably slower.

You can improve performance in a couple of ways:

  • Start selectors with #ID where possible:
    /* fastest */
    #content {..}
    
    /* slowest */
    div#content {..}
  • Avoid universal (*) selectors where possible:
    /* fastest */
    div.content {..}
    a[href] {..}
    
    /* slowest */
    .content {..}
    [href] {..}

Avoid using the strict CSS file

The optional module ie7-strict.js provides IE7 with strict CSS precedence. The bad news is that it drastically affects performance. Include this module only if you have to.



Article information
Wroted: Tue, 24 May 2005 01:04:00 EEST
Autors: Dean Edwards
Added by: AlexParamonov at Tue, 02 Dec 2008 01:04:50 EET
Translation information
This acticle in other languages: Russian
Added by: AlexParamonov at Tue, 02 Dec 2008 01:05:45 EET
Modified by: AlexParamonov at Wed, 03 Dec 2008 17:59:39 EET
Copyright © 2008-2010 Alexander Paramonov
Valid XHTML 1.0 Transitional