pre-allocated arrays (v24)

Revision 24 of this benchmark created 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
empty literal with if
var arr = [];
for (var i = 0; i < 1000000; i++) {
  if(i > 2 && arr[i - 2] > 34) {
    arr[i - 2] = 34;
  }
  arr[i] = i;
}
ready

Revisions

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