Push vs length (v14)

Revision 14 of this benchmark created by Adam Poczatek on


Test runner

Ready to run.

Testing in
TestOps/sec
length
var myArray = [];

for (var i = 0, l = 10000; i < l; i++) {
    myArray[myArray.length] = i;
}
ready
push
var myArray = [];

for (var i = 0, l = 10000; i < l; i++) {
    myArray.push(i);
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.