Hi Joel I did some more testing. I wrote a small sample with 3 different menus: 50 items, 100 items and 500 items (I know - 500 is a lot - but the page that I've analyzed actually had that many) I made the change to the library. For the 500 elements the superfish method takes 3459ms on my laptop with a total of 152222 JavaScript/DOM calls. After I changed the code to what I proposed the call took 3228ms and 146922 JavaScript/DOM calls. So - the change in my example improved my 500 items example by 220ms and saved about 5000 calls.
I used http://ajax.dynatrace.com for the analysis what do you think - worth making the change in your library? On Nov 2, 3:43 pm, grabnerandi <grabnera...@gmail.com> wrote: > I am not able to test it - at least not on the page I've found the > problem as the page is not under my control. > I am doing some web page analysis and discovered this issue and > believe that this change can significantly improve the performance. > > Once I find some time I can try it out on a local web-site that I have > under control > But thanks for agreeing to my conclusion - and yes - you are right - > we would need to wrap the "this" object - but that should still be > fater than calling the .eq method > > On Nov 2, 9:42 am, Joel Birch <joeldbi...@gmail.com> wrote: > > > > > Hello, > > > You would still need to wrap that "this" in a jQuery object, otherwise > > it refers to a DOM object. At that point, I would think that referring > > to an existing jQuery object, as Superfish currently does, would be > > preferrable. Are you able to test this, to be sure? > > > Thanks > > Joel Birch- Hide quoted text - > > - Show quoted text -