Skip to content

Commit

Permalink
benchmark: convert var to es6 const
Browse files Browse the repository at this point in the history
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: #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>
  • Loading branch information
sebasmurphy authored and refack committed Aug 17, 2017
1 parent aa011a1 commit c49dcb3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 57 deletions.
36 changes: 17 additions & 19 deletions benchmark/arrays/var-int.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
'use strict';
var common = require('../common.js');
const common = require('../common.js');

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

var bench = common.createBenchmark(main, {
type: types,
const bench = common.createBenchmark(main, {
type: [
'Array',
'Buffer',
'Int8Array',
'Uint8Array',
'Int16Array',
'Uint16Array',
'Int32Array',
'Uint32Array',
'Float32Array',
'Float64Array'
],
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);
Expand Down
36 changes: 17 additions & 19 deletions benchmark/arrays/zero-float.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
'use strict';
var common = require('../common.js');
const common = require('../common.js');

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

var bench = common.createBenchmark(main, {
type: types,
const bench = common.createBenchmark(main, {
type: [
'Array',
'Buffer',
'Int8Array',
'Uint8Array',
'Int16Array',
'Uint16Array',
'Int32Array',
'Uint32Array',
'Float32Array',
'Float64Array'
],
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);
Expand Down
36 changes: 17 additions & 19 deletions benchmark/arrays/zero-int.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
'use strict';
var common = require('../common.js');
const common = require('../common.js');

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

var bench = common.createBenchmark(main, {
type: types,
const bench = common.createBenchmark(main, {
type: [
'Array',
'Buffer',
'Int8Array',
'Uint8Array',
'Int16Array',
'Uint16Array',
'Int32Array',
'Uint32Array',
'Float32Array',
'Float64Array'
],
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);
Expand Down

0 comments on commit c49dcb3

Please sign in to comment.