Ah, very interesting, thanks. Yes, it makes a lot of sense to special case the very common '#id blah.blah' kind of selector.
-Mike On Wed, Sep 16, 2009 at 4:25 PM, John Resig <jere...@gmail.com> wrote: > As I mentioned in the talk, Sizzle is right-to-left but makes an exception > for when an ID is the first item in the selector - it uses that as the root > context, speeding things up. > > --John > > > > On Wed, Sep 16, 2009 at 6:34 PM, Jörn Zaefferer < > joern.zaeffe...@googlemail.com> wrote: > >> >> Sizzle also uses right-to-left, though I dunno if it makes exceptions >> when the selector has an #id. Going right-to-left is definitely much >> more efficient for selectors ala "div div". >> >> Jörn >> >> On Thu, Sep 17, 2009 at 12:22 AM, Michael Geary <m...@mg.to> wrote: >> > Steve Souders' talk? He mentioned the same thing at Google I/O, and he >> was >> > talking about how CSS engines in browsers - or at least the one in >> Firefox - >> > process selectors. >> > >> > He wasn't talking about how jQuery (or more specifically Sizzle) >> processes >> > selectors. >> > >> > If you're curious to know why CSS engines work right-to-left - or which >> ones >> > work this way - the CSS mailing list would be a good place to ask. I'm >> > curious about it too! >> > >> > John, does Sizzle work left-to-right or right-to-left? >> > >> > -Mike >> > >> > On Wed, Sep 16, 2009 at 1:38 PM, samer <samerzia...@gmail.com> wrote: >> >> >> >> Hi, >> >> >> >> I was reading over the slides at the conf, and I wanted to ask about >> >> the right to left for selectors. How is it more efficient to get all >> >> divs and then find the ID as opposed to get the ID and then get it's >> >> divs? >> >> >> >> scenario: >> >> >> >> #id div >> >> >> >> Thanks >> > >> > > >> > >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---