

JQuery 1.4.2 Released - Brentley_11
http://blog.jquery.com/2010/02/19/jquery-142-released/

======
jeff18
While it seems awesome that jQuery has doubled its speed in a single point
release, I'm tempted to look a gift horse in the mouth and ask why this is the
case? In WebKit (and increasingly FireFox and Opera), it seems like pretty
much everything jQuery does is matched by a native implementation. E.g.
document.querySelectorAll. There's not very much need to work around bugs like
there is in IE6.

Basically, it is awesome that performance has doubled again, but how far away
are we from native browser performance in modern browsers?

~~~
jeresig
The critical phrase is: "According to the numbers presented by the Taskspeed
benchmark..." Is jQuery, as a whole, 2x faster in 1.4.2 compared to 1.4.1?
Provably not - we didn't make changes to all of jQuery (and even if we did,
how would we determine a global improvement of that quantity in a reasonable
manner?).

That being said there were two areas in which there was genuine improvement
made that will affect your code:

* Continuing to improve the speed of remove/empty/html. These methods are heavily used so anything done here will improve your code, absolutely.

* Improving speed of inserting a single DOM node. This was an interesting case. In jQuery core we use DOM fragments to hold and insert DOM nodes. It's faster for when you have multiple DOM nodes to insert - but actually slightly slower if you only have one to insert. In that case we just route around it and insert the node directly (this sped of WebKit, for example).

Those are the changes that I'm most pleased with, for sure. It's easy to gauge
the difference between jQuery and native performance in absolute terms (time
in milliseconds) but at some point we simply won't be able to get any faster -
the overhead will be a couple function calls and some if/else statements
(which is effectively what's happened to a few jQuery methods). So yeah, I'm
not sure how far away we are but I will absolutely keep working towards that
getting us closer to that ideal.

------
Nycto
I've been using Prototype for, oh, maybe 4 years now. I really like it.
However, the rift between it and jQuery is becoming large enough that my
company is considering re-factoring our existing code to use jQuery instead.
It seems to have Prototype beat on speed, size, community, modularity and
compatibility. Any advice floating around out there? Are there any reasons to
stick with Prototype?

~~~
pmsaue0
The only reason I might come up with to stick w prototype is that it takes
time to switch you app to jQuery. That's the ONLY one. jQuery is too easy to
learn; way more community -- and in that regard, Scriptaculous is pretty much
dead.

if RoR you can use jRails to try to keep functionality in your app (if that's
what you use)

~~~
schammy
Agree 100%. I was a prototype user a long time ago. When I discovered jQuery I
couldn't believe how much more amazing it was. I'm a huge jQuery advocate now
and would never in a million years touch prototype ever again. jQuery just
makes sense, the code is so easy to write and so legible and logical, and
overall is the best thing that ever happened to javascript. I feel bad for
anyone still stuck on prototype - you have no idea what you're missing.

------
aswanson
Can someone summarize in a few sentences what jquery is and why I should learn
to use it?

~~~
simonw
It's more than a few sentences, but here's something I wrote a few years ago
about why jQuery should be of interest to JavaScript programmers:
<http://simonwillison.net/2007/Aug/15/jquery/>

------
CoryMathews
wow they say double speed improvement since 1.4.1

~~~
jellisjapan
That is pretty impressive. Also interesting that FF 3.5 seems to perform
better than FF 3.6 according to those charts. Edit: Ah, nevermind, my mistake.

~~~
jeresig
Other way around - be sure to double-check the raw data at the bottom (3.6 is
considerably faster than 3.5).

