push with presized and none

Benchmark created by gfx on


Test runner

Ready to run.

Testing in
TestOps/sec
new Array(non_zero)
(function (size, capacity) {
  var a = new Array(capacity);
  for (var i = 0; i < size; i++) {
    a[i] = (Math.random() * 0xffff) | 0; // SMI
  }

  let sum = 0;
  for (var i = 0; i < size; i++) {
    sum += a[i];
  }
  return sum;
})(100, 100);
ready
new Array(zero)
(function (size, capacity) {
  var a = new Array(capacity);
  for (var i = 0; i < size; i++) {
    a[i] = (Math.random() * 0xffff) | 0; // SMI
  }

  let sum = 0;
  for (var i = 0; i < size; i++) {
    sum += a[i];
  }
  return sum;
})(100, 0);
ready

Revisions

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