Push vs length (v36)

Revision 36 of this benchmark created on


Setup

var myArray, length = 10, i;

Test runner

Ready to run.

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

Revisions

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