Bhupi
Bhupi

Reputation: 2969

What are the likely main reasons my website is very slow on IE?

I need to know what can be the main reasons (apart from the basics like grouping CSS selectors, reducing image size, using image sprite etc.) which makes a website slow on Internet Explorer, because my website works fine on the others like FF, chrome etc.

  1. Is it the huge use of Javascript framework (ie. jQuery, extjs, prototype)?
  2. Is it because of the use of plugins based on JS framework?
  3. Should I use core javascript and remove the use of any js framework?
  4. Should I try to avoid using jQuery(document).ready()? in case of jQuery framework?

Above some of the questions which I know and please answer the questions which I couldn't ask because of lesser knowledge about these.

I need to make my website perform well on IE (6,7,8) also please suggest.

Thanks

Upvotes: 1

Views: 2115

Answers (4)

Paul D. Waite
Paul D. Waite

Reputation: 98786

Earlier versions of IE will, in general, run JavaScript slower than later versions of IE, because there have been advances in JavaScript compilation speed since then.

Upvotes: 0

Maxim Sloyko
Maxim Sloyko

Reputation: 15856

While you need to speed things up in IE, you can still use Firebug to look for places, that consume resources.

  • Install Yslow and see what it tells you
  • Run the site under profiler (Yslow or Firebug have one) and look for a bottleneck

It is very difficult to answer general questions like this, but jQuery is unlikely to be the one slowing everything down, just remember to

  • Use IDs as selectors wherever possible — they are the fastest, i.e. $('#myid')
  • Avoid using .class selectors without tagname, i.e. $('div.myclass') can be ten times faster than $('.myclass').

and so on

More tips for using jQuery to achieve better performance.

Upvotes: 2

mwilcox
mwilcox

Reputation: 4132

It has nothing to do with jQuery. The plugins however are hit or miss, and may not be well tested in IE. I'd use at your own risk.

DOM manipulation is very slow in IE. using appendChild (or insertRow) to add multiple nodes (say, 100+ for a long list) is much slower than building a string and doing one innerHTML.

You also want to be careful how you access nodes. Devs tend to rely upon jQuery too much and search for nodes via their class names, like:

$(".evenRows").hover(doSomething);

IE doesn't have a native way of getting a node by class name, so JQ is looping through the entire document and every single element and checking its class name... which needs to be checked via RegExp because it may look like:

class="evenRows yellow foo bar"

Finally, in spite of its improvements, IE8 is still using an old rendering engine - the same as IE6. Don't go crazy with the animations, and don't expect miracles.

Upvotes: 3

Dr.Molle
Dr.Molle

Reputation: 117314

As MSIE has a default-limit of 2 simultaneous connections you should minimize the number of requests that are required for building the page(use css-sprites, merge js-and css-files into a single file)

Upvotes: 2

Related Questions