[jQuery] Re: Attn. developers. Speed of getElementById

2007-06-27 Thread Rey Bango
Yeah, I saw that you posted it into Dev. I know John wanted you to share it with the dev group so thanks for posting it there. Rey Dmitrii 'Mamut' Dimandt wrote: Rey Bango wrote: Hi Dmitrii, Unfortunately, this isn't a JavaScript support mailing list. The list is here to support jQuery use

[jQuery] Re: Attn. developers. Speed of getElementById

2007-06-27 Thread Christof Donat
hI, > String comparison has to compare each char at each position. > "abc"="abc" would involve 3 iterations. > > "digitalbush.com"="digitalbush.com" would involve 15 iterations. That is only really relevant if you really need to do all the comparisons. I guess that browsers do a linear search t

[jQuery] Re: Attn. developers. Speed of getElementById

2007-06-27 Thread howa
Hi John, Currently jQuery don't have caching functions, wouldn't it be great if we add it? On 6月22日, 下午10時33分, "John Resig" <[EMAIL PROTECTED]> wrote: > Dimitii - > > test_results.PNG > 14K檢視下載 > > Those results are really interesting - you should post them to the jQuery > Dev list (where we

[jQuery] Re: Attn. developers. Speed of getElementById

2007-06-27 Thread Dmitrii 'Mamut' Dimandt
Rey Bango wrote: > > Hi Dmitrii, > > Unfortunately, this isn't a JavaScript support mailing list. The list > is here to support jQuery users. There are some great JavaScript > support forums at WebmasterWorld and SitePoint. > > If you have a specific jQuery issue, we'll be glad to help. Yeah, I kn

[jQuery] Re: Attn. developers. Speed of getElementById

2007-06-25 Thread Rob Desbois
Josh, that's all very true, but the reason that getElementById() is faster than getElementsByTagName() for example, is that it doesn't traverse the DOM to perform a string comparison of each element's ID. I don't know what the exact mechanism is, but I would assume it is a hash table from element

[jQuery] Re: Attn. developers. Speed of getElementById

2007-06-22 Thread Josh Bush
I can only imagine the longer the attribute, the longer the comparison will take. String comparison has to compare each char at each position. "abc"="abc" would involve 3 iterations. "digitalbush.com"="digitalbush.com" would involve 15 iterations. In the description at the top with "a, ano

[jQuery] Re: Attn. developers. Speed of getElementById

2007-06-22 Thread Su
Weird. It'd provide an interesting guideline if there's an id-length threshold where that slowdown kicks in. On 6/22/07, John Resig <[EMAIL PROTECTED]> wrote: Dimitii - Those results are really interesting - you should post them to the jQuery Dev list (where we discuss issues like selector spe

[jQuery] Re: Attn. developers. Speed of getElementById

2007-06-22 Thread John Resig
Dimitii - Those results are really interesting - you should post them to the jQuery Dev list (where we discuss issues like selector speed). More information about the list can be found here: http://docs.jquery.com/Discussion --John On 6/22/07, Dmitrii 'Mamut' Dimandt <[EMAIL PROTECTED]> wrote:

[jQuery] Re: Attn. developers. Speed of getElementById

2007-06-22 Thread Rey Bango
Hi Dmitrii, Unfortunately, this isn't a JavaScript support mailing list. The list is here to support jQuery users. There are some great JavaScript support forums at WebmasterWorld and SitePoint. If you have a specific jQuery issue, we'll be glad to help. Rey... Dmitrii 'Mamut' Dimandt wrot