Push vs length

JavaScript performance comparison

Revision 9 of this test case created by Tomas Corral

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
length
var b = new Array();
for(var i =0;i<100000; i++){
    b[b.length] = i;
};
pending…
push
var a = new Array();
for(var i =0;i<100000; i++){
    a.push(i);
};
pending…
concat
var a = new Array();
for(var i =0;i<100000; i++){
    a.concat([i]);
};
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.

0 Comments