Wednesday, July 11th, 2007
CSS Selectors - Speed Myths
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:













Jay for jQuery!
I’ve blogged about this before.
@Jordan: How does that affect this Ajaxian posting?
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)
@Rey Because nothing anyone else has to say could possible be more important LOL
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.
@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?
@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.
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
@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/
Alright, who let all the JQuery fanboys out of the clown car??? Show some Ext love :P.
@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. :)
@Mark: Well, Jack showed some jQuery love in his posting so we figured we were invited to the party! ;)
jQuery fanboy clowns have taken over the Internet.
I did some test, especially with jQuery on Windows XP & Vista, Mac OS X, Linux etc. The results confirm your testresults: The fastest browser still OPERA, not Safari ;o)
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.
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.
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