Push vs length vs static length (v38)

Revision 38 of this benchmark created on


Setup

var myArray, length = 1000, i;

Test runner

Ready to run.

Testing in
TestOps/sec
length
myArray = new Array(0);
for(i=0;i<length;i++){
  myArray.push('');
}
ready
push
myArray = new Array(0);
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.