0-fill n-size Array (v9)

Revision 9 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
for-loop Fill
var arr = [],
    l   = 100000;
arr.length = l;
for (var i = 0; i < l; ++i) {
  arr[i] = 0;
}
ready
for-loop Fill (uninitialised)
var arr = [],
    l   = 100000;
for (var i = 0; i < l; ++i) {
  arr[i] = 0;
}
ready
for-loop Fill (constructor initialised)
var l   = 100000,
    arr = new Array(l);
arr.length = l;
for (var i = 0; i < l; ++i) {
  arr[i] = 0;
}
ready
for-loop reverse-fill
var arr = [],
    l   = 100000;
for (var i = l; i--; ) {
  arr[i] = 0;
}
ready

Revisions

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