summaryrefslogtreecommitdiff
path: root/benchmark/assert/deepequal-typedarrays.js
blob: 1954c57ee59eeb47e852595705fa5760ed89c99b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'use strict';
var common = require('../common.js');
var assert = require('assert');
var bench = common.createBenchmark(main, {
  type: ('Int8Array Uint8Array Int16Array Uint16Array Int32Array Uint32Array ' +
    'Float32Array Float64Array Uint8ClampedArray').split(' '),
  n: [1]
});

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

  bench.start();
  var actual = new clazz(n * 1e6);
  var expected = new clazz(n * 1e6);

  // eslint-disable-next-line no-restricted-properties
  assert.deepEqual(actual, expected);

  bench.end(n);
}