Browse Source

benchmark: convert var to es6 const

Converted var variable to es6 const to maintain
consistency with other benchmark files. Also clean up
the types array to make the files more succinct.

PR-URL: https://github.com/nodejs/node/pull/12886
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
canary-base
Sebastian Murphy 8 years ago
committed by Refael Ackermann
parent
commit
c49dcb319b
No known key found for this signature in database GPG Key ID: CD704BD80FDDDB64
  1. 16
      benchmark/arrays/var-int.js
  2. 16
      benchmark/arrays/zero-float.js
  3. 16
      benchmark/arrays/zero-int.js

16
benchmark/arrays/var-int.js

@ -1,7 +1,8 @@
'use strict';
var common = require('../common.js');
const common = require('../common.js');
var types = [
const bench = common.createBenchmark(main, {
type: [
'Array',
'Buffer',
'Int8Array',
@ -12,17 +13,14 @@ var types = [
'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;
const type = conf.type;
const clazz = global[type];
const n = +conf.n;
bench.start();
var arr = new clazz(n * 1e6);

16
benchmark/arrays/zero-float.js

@ -1,7 +1,8 @@
'use strict';
var common = require('../common.js');
const common = require('../common.js');
var types = [
const bench = common.createBenchmark(main, {
type: [
'Array',
'Buffer',
'Int8Array',
@ -12,17 +13,14 @@ var types = [
'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;
const type = conf.type;
const clazz = global[type];
const n = +conf.n;
bench.start();
var arr = new clazz(n * 1e6);

16
benchmark/arrays/zero-int.js

@ -1,7 +1,8 @@
'use strict';
var common = require('../common.js');
const common = require('../common.js');
var types = [
const bench = common.createBenchmark(main, {
type: [
'Array',
'Buffer',
'Int8Array',
@ -12,17 +13,14 @@ var types = [
'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;
const type = conf.type;
const clazz = global[type];
const n = +conf.n;
bench.start();
var arr = new clazz(n * 1e6);

Loading…
Cancel
Save