pre-allocated arrays (v48)

Revision 48 of this benchmark created by RobbertC5 on


Test runner

Ready to run.

Testing in
TestOps/sec
empty literal
var arr = [];
for (var i = 0; i < 1000000; i++) {
  arr[i] = i;
}
ready
pre-allocated array
var arr = new Array(1000000);
for (var i = 0; i < 1000000; i++) {
  arr[i] = i;
}
ready
holey array
var arr = [];
arr[999999] = 999999;
for (var i = 0; i < 1000000; i++) {
  arr[i] = i;
}
ready

Revisions

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