OK, here is an interesting tidbit.

I used the test below and and did the 7 click thing, and out of all my 
tests except one, the long delay happened in has() and once I got it in 
find(). has() is pretty simple and I wonder if this has less to do with 
the number of clicks versus the number of regex's we use and dispose or 
something like that.

I love testing!!! It makes one look at what is happening and sometimes 
you are surprised! but the questions and introspection are always good 
on occasion.

-Steve

Aaron Heimlich wrote:
> If you want some more detail (and have Firefox with Firebug 1.0 Beta 
> installed), you can head on over to 
> http://aheimlich.freepgs.com/tests/jquery/speed-test-firebug/ 
> <http://aheimlich.freepgs.com/tests/jquery/speed-test-firebug/> where I 
> replicated Karl's tests using Firebug 1.0 Beta's script profiling 
> abilities. The results aren't much different from Karl's, but there's 
> still some interesting stuff there like:
> 
> $(.dialog) does 815 function calls (!!!!)
> $('#speech28') does 6 function calls
> 
> On 12/18/06, *Karl Swedberg* <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
>     Thank you for that summary, Jake! And for the stat lesson. :)
> 
> 
>     On Dec 18, 2006, at 11:19 PM, Ⓙⓐⓚⓔ wrote:
> 
>>     Since the 7th click is reproducible, and has little to do with the
>>     issue, you can discard the value, with a simple note... years of
>>     stat classes!
>>
>>     conclusions:
>>     running thru the whole dom looking for a class is slow.
>>     looking for an ID (which should be unique) after getting the tags
>>     is worthless.
>>     looking for a class after getting a subset of the dom is faster
>>     than searching the whole dom.
>>     Safari is almost always faster than ff!
>>     Just what was expected!
>>
>>     GREAT WORK!
>>
>>     On 12/18/06, *Karl Swedberg* < [EMAIL PROTECTED]
>>     <mailto:[EMAIL PROTECTED]>> wrote:
>>
>>         Hey everyone,
>>
>>         I have results of a few more speed tests that I ran this
>>         evening at
>>         http://test.learningjquery.com/speed-test.htm
>>
>>         Method: I clicked 10 times on each query in Firefox 2.0 and
>>         Safari 2.0.4 (See HTML source for all code, markup, etc.) I
>>         recorded the mode (most common value) and the range of values
>>         for each, all in milliseconds.
>>
>>         @ FF2 / Safari2
>>
>>         *1. $('#speech28') *
>>         - mode: 1 / 1
>>         - range: 0-1 / 0-4
>>
>>         *2. $('div#speech28')  *
>>         - mode: 43 / 32
>>         - range: 42-59 / 30-35
>>
>>         *3. $('#final-speech div.final-dialog ') *
>>         - mode: 5ms / 5ms
>>         - range: 4-6 / 3-6
>>
>>         *4. $('#final-speech .final-dialog')*
>>         - mode: 6 / 5
>>         - range: 5-8 / 3-6
>>
>>         *5. $('div.final-dialog')*
>>         - mode: 55 / 40
>>         - range: 28-253  / 40-45
>>
>>         *6. $('.final-dialog')*
>>         - mode: 101 / 51
>>         - range: 83-306 / 51-68
>>
>>         ***
>>         Note that queries 5 and 6 have huge ranges in Firefox because
>>         of the mysterious seventh click issue.
>>
>>         Looks like these tests confirm what we've all been saying on
>>         this list about the relative speed of various selectors. 
>>
>>         This has been a fascinating exercise. I'd love to hear
>>         people's analysis, etc. 
>>
>>
>>         --Karl
>>         _______________________
>>         Karl Swedberg
>>         www.englishrules.com <http://www.englishrules.com>
>>         www.learningjquery.com <http://www.learningjquery.com>
>>
>>
>>         _______________________________________________
>>         jQuery mailing list
>>         discuss@jquery.com <mailto:discuss@jquery.com>
>>         http://jquery.com/discuss/ <http://jquery.com/discuss/>
>>
>>
>>
>>
>>
>>     -- 
>>     Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ
>>     _______________________________________________
>>     jQuery mailing list
>>     discuss@jquery.com <mailto:discuss@jquery.com>
>>     http://jquery.com/discuss/
> 
> 
>     _______________________________________________
>     jQuery mailing list
>     discuss@jquery.com <mailto:discuss@jquery.com>
>     http://jquery.com/discuss/
> 
> 
> 
> 
> 
> -- 
> Aaron Heimlich
> Web Developer
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> http://aheimlich.freepgs.com <http://aheimlich.freepgs.com>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to