Sha256: 89b50954f65253678ba14f8300e57c7032deb11cb8c649d67fba20883533a78d

Contents?: true

Size: 573 Bytes

Versions: 2

Compression:

Stored size: 573 Bytes

Contents

'use strict';
var common = require('../common.js');

var types = [
  'Array',
  'Buffer',
  'Int8Array',
  'Uint8Array',
  'Int16Array',
  'Uint16Array',
  'Int32Array',
  'Uint32Array',
  'Float32Array',
  'Float64Array'
];

var bench = common.createBenchmark(main, {
  type: types,
  n: [25]
});

function main(conf) {
  var type = conf.type;
  var clazz = global[type];
  var n = +conf.n;

  bench.start();
  var arr = new clazz(n * 1e6);
  for (var i = 0; i < 10; ++i) {
    for (var j = 0, k = arr.length; j < k; ++j) {
      arr[j] = 0.0;
    }
  }
  bench.end(n);
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
node-compiler-0.9.1 vendor/node/benchmark/arrays/zero-float.js
node-compiler-0.9.0 vendor/node-v7.2.1/benchmark/arrays/zero-float.js