Array direct assignment vs push (big array) (v48)

Revision 48 of this benchmark created on


Setup

var directArray = [];
    var pushArray = [];
    var presizedArray = Array(100000);

Test runner

Ready to run.

Testing in
TestOps/sec
Direct assignment
for(var i = 0; i < 100000; i++)
{
  directArray[i] = "test";
}
ready
Push
for(var i = 0; i < 100000; i++)
{
  pushArray.push("test");
}
ready
Direct assignment with pre-allocate
for(var i = 0; i < 100000; i++)
{
  presizedArray[i] = "test";
}
ready

Revisions

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