Push vs length (v21)

Revision 21 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
length
var myArray = [];
for (i = 0; i <= 100000; i++) {
  myArray[myArray.length] = i;
}
ready
push
var myArray = [];
for (i = 0; i <= 100000; i++) {
  myArray.push(i);
}
ready
third
var myArray = new Array(100000);
for (i = 0; i <= 100000; i++) {
  myArray[myArray.length] = i;
}
ready

Revisions

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