Hi as I remembered a while ago maybe at jQuery 1.2x or 1.3x, people recommended using .find or $(selector, context), one thing is simply because .find was just faster. Then I think it was John himself said that they both should do the same thing (performance wise). Now at jQuery 1.4 or 1.5, I think the two methods should be the same speed.
Without looking at the source code again, i think .find is faster by one function call. see : http://addyosmani.com/blog/8-jquery-performance-tips/ Also when your caching the dom why not just cache it as a jQuery object then you can use .find directly. correct me if i am wrong ^^ On Fri, Jan 21, 2011 at 2:00 PM, Bill Heaton <[email protected]> wrote: > Correction: > > http://jsperf.com/jquery-selector-with-context-as-object/5 > > > Oops, I forgot the link that I am requesting you to click the 'Run > > tests' button at : > > Sorry everyone for the multiple posts I think I need to get some > sleep. > > Thanks in advance for clicking the 'run tests' on the > http://jsperf.com/jquery-selector-with-context-as-object/5 > > Best regards, > > -Bill > > -- > To view archived discussions from the original JSMentors Mailman list: > http://www.mail-archive.com/[email protected]/ > > To search via a non-Google archive, visit here: > http://www.mail-archive.com/[email protected]/ > > To unsubscribe from this group, send email to > [email protected]<jsmentors%[email protected]> > -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
