Zero filled array creation (v12)

Revision 12 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Array push
for (var i = 0, a = []; i < 100; i++) a.push(0);
ready
Array assign
for (var i = 0, a = new Array(100); i < 100;) a[i++] = 0;
ready
Typed array conversion
[].slice.call(new Uint8Array(100));
ready
CoffeeScript
var array, i, _i;

array = new Array(100);

for (i = _i = 0; _i < 100; i = _i += 1) {
  array[i] = 0;
}
ready
split join floor
for (var i = 0, a = Array(101).join("0").split(""), len = a.length; i < len; i++) {
    a[i] = Math.floor(a[i]);
}
ready
split join |0
for (var i = 0, a = Array(101).join("0").split(""), len = a.length; i < len; i++) {
    a[i] = (a[i] |0);
}
ready

Revisions

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