Array Object vs Array Literal (v3)

Revision 3 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Object
var num = 100000;
var foo = new Array(num);

for (var n = 0; n < num; n += 1)
{
  foo[n] = new Array();
}
ready
Literal
var num = 100000;
var foo = [];
foo.length = num;

for (var n = 0; n < num; n += 1)
{
  foo[n] = [];
}
ready

Revisions

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