Well, there's a lot of thing to take into consideration. for example, on chrome quite about every loop take 0ms with every methods, see it yourself.
IE have a + or - 15ms of accuracy, so you could use this: http://iejst.codeplex.com/ to test real javascript speed on ie... I *really* don't reccomend to do micro-optimization in general, and I want to suggest you to don't use my fastest device :) On Apr 22, 9:12 pm, Trevor Orr <[email protected]> wrote: > That is a very interesting page. So apparently this method is the fastest > when do a lot of looping. At least on my machine. By looking at the > function I would never have thought that possible but that is what that > benchmark page shows. > > function kentaromiuraFastestDevice(iterations) { > var testVal=iterations; > if(parseInt(iterations/8)){ > var n=iterations%8; > do{ > --testVal; //do stuff > --testVal; //do stuff > --testVal; //do stuff > --testVal; //do stuff > --testVal; //do stuff > --testVal; //do stuff > --testVal; //do stuff > --testVal; //do stuff > }while(testVal!=n);} > > while(testVal--){ > //do stuff > > } > } > On Thu, Apr 22, 2010 at 11:59 AM, eskimoblood <[email protected]> wrote: > > WebReflection has a complete test page for all the different > > approaches to loop over an array: > >http://devpro.it/examples/loopsbench/ > > > But keep in mind: premature optimization is the root of all evil > > > -- > > Subscription settings: > >http://groups.google.com/group/mootools-users/subscribe?hl=en
