Demystifying jQuery selector optimization(no-margin-for-errors.com)
no-margin-for-errors.com
Demystifying jQuery selector optimization
http://www.no-margin-for-errors.com/2009/04/28/demystifying-the-jquery-selectors-optimization/
2 comments
(I think the author of the blog post was a "she")
Do you have some links to other selector optimization tests/benchmarks/posts? I'd be interested in seeing those as well
Do you have some links to other selector optimization tests/benchmarks/posts? I'd be interested in seeing those as well
It doesn't feel like an overly comprehensive test to me either. He also doesn't mention how many test cycles he's running, browser versions, etc.
I don't know if it helps, but I talked to John Resig last Friday night after day 1 of JSConf2009. I specifically was asking about how Sizzle works when selecting. The jist of it is that Sizzle selects the maximum number of possible elements, then pairs them down until it finds the ones you are looking for. I haven't dugg back into the Sizzle code yet to really see how this is being done, but it might help others who are curious.
In anycase it is probably more worthwhile to optimize for the slowest browsers that you want to be compatible with, and those browsers are not firefox unless you don't care about like half of the people on the internet.
edit - just to clarify, based upon his results I'm guessing he's only using firefox to run these tests.