Alright, jqbench updated... now, traversing 10 levels of divs:
- Using parentNode: 264ms; - Using the bifurcated code: 89ms. Now, with more levels, it starts to be a big difference... what do you think of it? Diogo On Tue, Dec 2, 2008 at 5:40 PM, Ariel Flesler <[EMAIL PROTECTED]> wrote: > > Ok... but this is not something we'll call too often... > > Did you try with different depths ? that is, nodes that are more and > less nested into the dom. > > That should change the numbers, probably making the bifurcated one a > little faster (when deeper). > > On Tue, Dec 2, 2008 at 3:46 PM, Diogo Baeder <[EMAIL PROTECTED]> > wrote: > > OK, let's talk about numbers - 1000 calls to the methods, in my > benchmark: > > > > Using parentNode: 156ms; > > Using the bifurcated code: 99ms. > > > > Diogo > > > > > > > > On Tue, Dec 2, 2008 at 4:26 PM, Ariel Flesler <[EMAIL PROTECTED]> > wrote: > >> > >> If the bifurcated one isn't CLEARLY faster, then +1 for Diego's. > >> We don't tend to do that and it's ugly code IMO (the bifurcated one that > >> is) > >> > >> On Tue, Dec 2, 2008 at 2:17 PM, John Resig <[EMAIL PROTECTED]> wrote: > >> > > >> >> To be honest, John, I haven't tested this implementation using > >> >> frames... if > >> >> you say yes, it works, then I think we could stick with it... but > >> >> wouldn't > >> >> it be a little (just a little) faster to get "doc" outside the method > >> >> call, > >> >> in an outter scope, to maximize performance? It seems to me that it > was > >> >> one > >> >> of the points that lowered 30% the time for processing the call, in > my > >> >> benchmarks... > >> > > >> > Well, the problem is that if we move doc to an outside scope it'll > >> > either A) Cause some code to break (outer documents, etc.) or B) > >> > Require us to do a conditional to determine which document to use - at > >> > which point we're worse off then we are now. > >> > > >> > IMO I would go with whichever one is faster - the one that I proposed > >> > or Diego's (since they work equally across all documents). > >> > > >> > --John > >> > > >> > > > >> > > >> > >> > >> > >> -- > >> Ariel Flesler > >> http://flesler.blogspot.com > >> > >> > > > > > > > > -- > > Diogo Baeder > > http://www.diogobaeder.com.br > > > > > > > > > > > -- > Ariel Flesler > http://flesler.blogspot.com > > > > -- Diogo Baeder http://www.diogobaeder.com.br --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---
