Big Array Build

JavaScript performance comparison

Test case created by Jeremy

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Push Build
var ary = new Array();

for(x=0;x<100000;x++){

   ary.push(true);

}
pending…
Index Build
var ary = new Array();

for(x=0;x<100000;x++){

   ary[x] = true;

}
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

1 comment

Mike Murry commented :

It generally preferred to define JavaScript arrays as array literals (var ary = [];) instead of array objects (var ary = new Array();).

See: http://jsperf.com/literal-vs-constructor-array/4

Add a comment