In Opera I was able to perform similar timing with much more repetitions. Conclusion: 'init' function is double faster then 'push' function
On Sep 2, 5:16 am, Robert Katić <[EMAIL PROTECTED]> wrote: > I wrote small profilehttp://pastie.textmate.org/93190that I paste on > firebug. > > This is results on my laptop: > > Size: 100 Times: 10000 > push: 4672ms > init: 2922ms > > Size: 10 Times: 10000 > push: 266ms > init: 594ms > > Size: 4 Times: 10000 > push: 141ms > init: 79ms > > On Sep 2, 4:31 am, Tobie Langel <[EMAIL PROTECTED]> wrote: > > > Can we have benchmarks ? > > > On Sep 1, 7:32 pm, Robert Katić <[EMAIL PROTECTED]> wrote: > > > > I have another question about $A and similar. > > > > Why you prefer do this > > > > var results = []; > > > for (var i = 0, length = iterable.length; i < length; i++) > > > results.push(iterable[i]); > > > > instead of > > > > var length = iterable.length, results = new Array(length); > > > for (var i = 0; i < length; i++) > > > results[i] = iterable[i]; > > > > It's more faster! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype: Core" 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/prototype-core?hl=en -~----------~----~----~----~------~----~------~--~---
