views:

1311

answers:

4

jQuery 1.4 released recently and the new website shows some performance charts where 1.4 is clearly better, but has someone already done an analysis of overall performance improvement of 1.4 vs 1.3? If not, how do I profile both on my sites/pages, are there any tools?

Can't wait to find out how fast is 1.4 compared to the previous version.

Edit: A blogger did some tests and found that its about 30% faster in FF but slower (compared to 1.3) in Safari. Hmm...

+1  A: 

This report says that jQuery have massive performance improvements in 1.4

http://www.stevesouders.com/blog/2010/01/15/jquery-14-performance/

BarsMonster
A: 

Well.. After I updated jQuery for a project (with extensive DOM manipulation), I noticed an overall performance improvement. So I guess those reports are for real (or pretty close to the reality)

Ionut Staicu
A: 

There is an official page about the performance improvements from the jQuery team, perhaps this is a good start: http://jquery14.com/day-01/jquery-14#backwards

cwaidner
+5  A: 

Their diagrams only show one side of the story. I've recently been working on a script that involves iterating over thousands of input elements throughout the DOM tree and traversing their parent elements. According to Firebug, jQuery 1.4 runs roughly 30% slower that 1.3.2 on the exact js and DOM structure.

That's not to say that 1.4 isn't "faster" in general though, and this is only in one browser I've profiled in. I think that this time their efforts where more focused on speeding up areas that related to dynamic content creation rather than dealing with existing static elements.

Just thought I should also point that those charts list the number of function calls, not the execution time. Fewer function calls doesn't always translate to lower execution time. In my situation 1.4 executes about 20% fewer calls but runs about 30% slower.

ScottyUCSD
jQuery 1.4 focused on improving the speed of some of the most commonly used functions, such as `addClass()`, `removeClass()`, `css()`, `remove()`, `html()` and `empty()`. John Resig blogged about how he went about profiling jQuery to identify problem spots in the code base and how they specifically were sped up. The speed improvements jQuery 1.4 touts are in functions that specifically performed poorly in jQuery 1.3, so your mileage may vary as to what improvements you'll see.
Dan Herbert