On Tue, 29 Sep 2009, A.Yerenkow wrote:

>> Another "interesting" result:
>>
>> n = 20000000;
>> var k, d=[];
>> for (k=0; k<n; k++) {
>>     d[d.length]=k;
>> }
>>
>> is basically as fast as
>>
>> n = 20000000;
>> var d = new Array(n);
>> var t2= new Date().getTime();
>> for (k=0; k<n; k++) {
>>     d[k] = k;
>> }

> maybe you want to put new Date() inside loop?

No, it just needs to be deleted ... as you can see from my other examples I
hadn't posted the time measurement code and I just forgot to delete it in
this example.

>> and about 40% faster (FF 3.5.3) and about 10% faster (Chrome) as the
>> push-version while doing exactly the same.  Is this due to the method call
>> overhead of .push() or does push() do something fancy?

The difference is not from that ...

Cheers,
Fritz

-- 
Oetiker+Partner AG              tel: +41 62 775 99 03 (direct)
Fritz Zaucker                        +41 62 775 99 00 (switch board)
Aarweg 15                            +41 79 675 06 30 (mobile)
CH-4600 Olten                   fax: +41 62 775 99 05
Schweiz                         web: www.oetiker.ch

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to