Wednesday, July 11th, 2007

CSS Selectors – Speed Myths

Category: CSS, JavaScript, Library

Jack Slocum has continued the CSS Selector trend by taking another look at the various frameworks and dispelling some CSS Selectors Speed Myths.

Jack talks about the various approaches, comparing Firefox support to cross browser support, and tweaks the slickspeed tests with a few others, ending up with:

Ext CSS Selector Tests

Posted by Dion Almaer at 5:22 am
17 Comments

++++-
4.1 rating from 56 votes

17 Comments »

Comments feed TrackBack URI

Jay for jQuery!

jQuery’s recent 1.1.3 release gave it quite a big boost in performance. jQuery, like Ext, does not use XPath in FireFox. Credit goes to John Resig for the most efficient nth-child implementation I have seen to date. In fact, Ext 1.1’s new nth-child implementation is modeled very closely after it.

jQuery was the only library other than Ext that passed all the tests.

Like jQuery, Ext supports unlimited chaining of filters and selectors and querying XML Documents.

Comment by Gilles — July 11, 2007

I’ve blogged about this before.

Comment by Jordan — July 11, 2007

@Jordan: How does that affect this Ajaxian posting?

Comment by Rey Bango — July 11, 2007

Surely it’s got the stage where all libraries are pretty damn fast and we can move on to discussing more important issues? (and yeah, props to jquery for the amazing speed boost in 1.1.3)

Comment by Tamlyn Rhodes — July 11, 2007

@Rey Because nothing anyone else has to say could possible be more important LOL

Comment by justin — July 11, 2007

I think that XPath is the way to go since Firefox, Safari 3.x, Opera 9.5 support them and if they add that support in IE 8 it then all major browsers will have lightning fast DOM retrieval. Using a pure JS solution should only be used as a fall back solution for older browsers since native browser functionality will always be faster than a JS solution.

Comment by Spocke — July 11, 2007

@Justin: LOL! Well, if there were a link at least to his blog post, then I could judge the relevancy & importance, right? Otherwise, whats the point in saying “I’ve blogged about this before.”? Kapish?

Comment by Rey Bango — July 11, 2007

@Spocke: If Firefox, Safari 3.x, & Opera 9.5 were the dominant browsers, I’d agree with you. Until then, you really need to have consider IE when optimizing anything.

Comment by Rey Bango — July 11, 2007

Nice test with useful information …(aside) one item I especially like about jQuery is how well it works with other libs, enabling us to use the best of both worlds:
http://docs.jquery.com/Using_jQuery_with_Other_Libraries

Comment by Mark Holton — July 11, 2007

@spocke
Ext is actually faster in Safari 3 Win and Mac and I don’t see how Opera can get much faster. It is already blazing. ;)

http://coreygilmore.com/blog/2007/07/10/css-selector-speed-tests-using-slickspeed/

Comment by Jack Slocum — July 11, 2007

Alright, who let all the JQuery fanboys out of the clown car??? Show some Ext love :P.

Comment by Mark — July 11, 2007

@Jack Slocum
Yeah, I’m amazed with the performance of Safari 3 and Opera. I’m having a hard time to even measure those since most of the test just comes up with 0ms in all the tests. :)

Comment by Spocke — July 11, 2007

@Mark: Well, Jack showed some jQuery love in his posting so we figured we were invited to the party! ;)

Comment by Rey Bango — July 11, 2007

jQuery fanboy clowns have taken over the Internet.

Comment by Steve — July 11, 2007

so what you’re saying is, aside from the speed testing aspect, is that 5 open source projects written by a bunch of lazy javascript programmers have better CSS selector support than IE7.

Comment by killchriswilson — July 12, 2007

In general Opera just feels great as a browsing tool due to its all-around speed. I really wish the community had made it the darling instead of Firefox.

Comment by Ivan — July 12, 2007

I tested using the tool provided and on every browser on the Mac at least Prototype came out as the clear leader. Faster Times, found more elements, and didn’t throw any exceptions (except in Safari2). Now I haven’t tested windows but this already shows that the results above are inaccurate.

Also, why does the test use selectors that are unsupported? What good does that do in the analysis?

Just a few of my thoughts.

Thanks for your time and effort,

Kevin

Comment by Kevin — July 13, 2007

Leave a comment

You must be logged in to post a comment.