My results: $('body') 1.33ms 0.64ms 0.62ms $('body div') 34.38ms 34.38ms 34.06ms $('div', [jQuery('div'), jQuery('a')]) 69.06ms 68.12ms 67.82ms document.body.getElementsByTagName('div') 0ms 0ms 0ms $(jQuery.merge(document.getElementsByTagName('div'), [])) 23.12ms 23.12ms 23.44ms $('div') 32.5ms 33.12ms 32.82ms document.getElementsByTagName('div') 0ms 0ms 0ms $('*') 50.62ms 54.36ms 55.94ms document.getElementsByTagName('*') 0ms 0ms 0ms $('.dialog') 61.86ms 65.62ms 68.44ms $('div.dialog') 43.76ms 43.74ms 44.06ms $('div').filter('.dialog') 47.2ms 45ms 50.94ms $('div#speech5') 40ms 39.68ms 42.82ms $('div #speech5') 34.06ms 32.18ms 34.38ms $('#speech5', document.getElementsByTagName("div")) 0.64ms 0.62ms 0.64ms $('div').filter('#speech5') 44.06ms 40.62ms 43.76ms $('#speech5').filter('div') 0.62ms 0.64ms 0.62ms $('#speech5') 0.32ms 0.32ms 0.62ms $('body > div.scene div#speech5') 49.38ms 51.56ms 55.32ms $('div.scene div.dialog') 87.18ms 87.5ms 88.44ms
<!----------------//------ andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --------------//---------> -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Yehuda Katz Sent: Tuesday, December 19, 2006 11:01 AM To: jQuery Discussion. Subject: [jQuery] Speed Tests In the vein of the discussion we've been having on this list (and, of course, heavily inspired by the first speed test), I've created a more extensive speed test that tests a bunch of similar cases. A word of warning: your browser will not be available for a good 30 seconds or so while the test is running, but it will not lock up. The first thing my code does is test how long it takes to run a $(".class") query, and bases the number of attempts for each test on the speed of that query (not a perfect system, but it should prevent crazy long loads on slow computers. Check the test out at: http://yehuda.jquery.com/jq_test.html -- Yehuda Katz Web Developer | Wycats Designs (ph) 718.877.1325
_______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/