new array vs literal (v17)

Revision 17 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Array Literal & push
var newArray = [0, 0, 0, 0];
  newArray[0] = Math.random();
  newArray[1] = Math.random();
  newArray[2] = Math.random();
  newArray[3] = Math.random();
ready
new Array(count)
var newArray = [null, null, null, null];
  newArray[0] = Math.random();
  newArray[1] = Math.random();
  newArray[2] = Math.random();
  newArray[3] = Math.random();
 
ready

Revisions

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