[jQuery] Re: jQuery selector performance / jQuery Tester

2009-07-03 Thread olsch01
@Karl: o, that was a serious cp bug... :) I was aware that IE6 and 7 don't support getElementsByClassName (see my initial message), still the results of my first test showed similar results for the class selector. I hope I didn't have another cp bug in there... ;) @Mike: the pages I'm

[jQuery] Re: jQuery selector performance / jQuery Tester

2009-07-03 Thread olsch01
I re-ran the test now. test('#content a.submit'); test('a.submit'); test('.submit'); test('(#content).find(a.submit)'); Basically I get the same result: for my pages (!) element.MyClass has the best average performance. I guess it's as Karl mentioned earlier: If the selectors aren't causing a

[jQuery] Re: jQuery selector performance / jQuery Tester

2009-07-02 Thread Karl Swedberg
On Jul 2, 2009, at 8:45 AM, north wrote: Hi, I just tested all my jQuery selectors using the jQuery Tester (http:// jquery.nodnod.net), and the results seem to contradict one thing I read in a performance article: that you should descend from the closest parent ID when using classes in your

[jQuery] Re: jQuery selector performance / jQuery Tester

2009-07-02 Thread olsch01
Hi Karl, thanks for your reply. I used jQuery tester in FF2 + 3, IE6, 7 + 8, Opera 9.64 and I think also in Safari 4 (on my Win XP machine). The results were are all kinda similar. Using the class selector was always fastest. I just ran the following test (choosing jQuery 1.3.2 again):

[jQuery] Re: jQuery selector performance / jQuery Tester

2009-07-02 Thread Karl Swedberg
If you're doing this: test('#content a.submit'); then you shouldn't compare it to this: test('(#myDiv).find(span.myClass)'); that's apples to oranges. instead, compare it to this: test('(#content).find(a.submit)'); The reason the other browsers are so much faster than IE 6 and 7with bare

[jQuery] Re: jQuery selector performance / jQuery Tester

2009-07-02 Thread Michael Geary
You can't measure whether one selector will be faster than another on all possible pages. All you can measure is which is faster on the page you're testing. On a page with only a single a element, an 'a.submit' or even just an 'a' selector will be faster than '#content a.submit', because it's