Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Jquery slower in IE?

I have a complex ASP.NET page that makes heavy usage of jquery for DOM manipulation (no AJAX). The page is faster in Mozilla based browsers (Firefox) compared to IE 7 or 8.

Are there some functions that are optimized for FF?

like image 924
Nick Avatar asked Aug 05 '09 14:08

Nick


3 Answers

The power is in the javascript processing engine. Unlike serverside processing (PHP, ASP.net), javascript is client side, meaning that your visitor's browser all have to do the work of rendering the page. Competitors try to get people to switch to their browser by boasting faster processing of things like javascript.

This leads to all the browsers having their own processing engines. Which leads to some browsers being slower. IE:

Internet Explorer doesn't use the Mozilla Engine, so it is considerably slower than Firefox. Internet Explorer is known as one of the slower engines out of all the major browsers.

Firefox is slower than Chrome, which boats one of the highest Javascript Engines (A Modified Version of Webkit).

Safari I believe is currently the fastest rendering engine out there.

You can see more stats on this article from PCWorld, and here

like image 116
Tyler Carter Avatar answered Nov 19 '22 08:11

Tyler Carter


Well, the JavaScript engine itself is faster in Firefox, so that would naturally extend to jQuery being faster.

Web Browser               Average Runtime     Relative
-----------               ---------------     --------
Safari 4.0.2 (530.19.1)        169          1x (fastest)
Chrome 2.0.172.33              349          2.1x slower
Firefox 3.5                    377          2.2x slower
Opera 9.64 (10487)             442          2.6x slower
IE 8.0                         771          4.6x slower

Source: http://celtickane.com/labs/web-browser-javascript-benchmark/

like image 7
John Rasch Avatar answered Nov 19 '22 08:11

John Rasch


Some benchmarks on JavaScript by browser: http://celtickane.com/labs/web-browser-javascript-benchmark/

like image 4
Matthew Groves Avatar answered Nov 19 '22 07:11

Matthew Groves