Skip to content

Commit

Permalink
benchmark: add trailing commas in benchmark/util
Browse files Browse the repository at this point in the history
PR-URL: #46438
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
aduh95 authored and MylesBorins committed Feb 18, 2023
1 parent 51c6c61 commit 8b88d60
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 18 deletions.
1 change: 0 additions & 1 deletion benchmark/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ overrides:
- path/*.js
- process/*.js
- url/*.js
- util/*.js
rules:
comma-dangle: [error, {
arrays: always-multiline,
Expand Down
2 changes: 1 addition & 1 deletion benchmark/util/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const inputs = {

const bench = common.createBenchmark(main, {
n: [1e5],
type: Object.keys(inputs)
type: Object.keys(inputs),
});

function main({ n, type }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/util/inspect-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, {
'sparseArray',
'mixedArray',
'denseArray_showHidden',
]
],
});

function main({ n, len, type }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/util/inspect-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const common = require('../common.js');
const bench = common.createBenchmark(main, {
n: [1e5],
showProxy: [0, 1],
isProxy: [0, 1]
isProxy: [0, 1],
});

function main({ n, showProxy, isProxy }) {
Expand Down
4 changes: 2 additions & 2 deletions benchmark/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const common = require('../common.js');
const opts = {
showHidden: { showHidden: true },
colors: { colors: true },
none: undefined
none: undefined,
};
const bench = common.createBenchmark(main, {
n: [2e4],
Expand All @@ -25,7 +25,7 @@ const bench = common.createBenchmark(main, {
'TypedArray_extra',
'Number',
],
option: Object.keys(opts)
option: Object.keys(opts),
});

function benchmark(n, obj, options) {
Expand Down
6 changes: 3 additions & 3 deletions benchmark/util/normalize-encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const groupedInputs = {
group_upper: ['UTF-8', 'UTF8', 'UCS2',
'UTF16LE', 'BASE64', 'UCS2'],
group_uncommon: ['foo'],
group_misc: ['', 'utf16le', 'hex', 'HEX', 'BINARY']
group_misc: ['', 'utf16le', 'hex', 'HEX', 'BINARY'],
};

const inputs = [
Expand All @@ -21,9 +21,9 @@ const inputs = [

const bench = common.createBenchmark(main, {
input: inputs.concat(Object.keys(groupedInputs)),
n: [1e5]
n: [1e5],
}, {
flags: '--expose-internals'
flags: '--expose-internals',
});

function getInput(input) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/util/priority-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const common = require('../common');

const bench = common.createBenchmark(main, {
n: [1e5]
n: [1e5],
}, { flags: ['--expose-internals'] });

function main({ n, type }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/util/text-decoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, {
fatal: [0, 1],
len: [256, 1024 * 16, 1024 * 512],
n: [1e2],
type: ['SharedArrayBuffer', 'ArrayBuffer', 'Buffer']
type: ['SharedArrayBuffer', 'ArrayBuffer', 'Buffer'],
});

function main({ encoding, len, n, ignoreBOM, type, fatal }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/util/text-encoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, {
len: [16, 32, 256, 1024, 1024 * 32],
n: [1e4],
type: ['one-byte-string', 'two-byte-string', 'ascii'],
op: ['encode', 'encodeInto']
op: ['encode', 'encodeInto'],
});

function main({ n, op, len, type }) {
Expand Down
12 changes: 6 additions & 6 deletions benchmark/util/type-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ const args = {
ArrayBufferView: {
'true': dataView,
'false-primitive': true,
'false-object': arrayBuffer
'false-object': arrayBuffer,
},
TypedArray: {
'true': int32Array,
'false-primitive': true,
'false-object': arrayBuffer
'false-object': arrayBuffer,
},
Uint8Array: {
'true': uint8Array,
'false-primitive': true,
'false-object': int32Array
}
'false-object': int32Array,
},
};

const bench = common.createBenchmark(main, {
type: Object.keys(args),
version: ['native', 'js'],
argument: ['true', 'false-primitive', 'false-object'],
n: [1e5]
n: [1e5],
}, {
flags: ['--expose-internals', '--no-warnings']
flags: ['--expose-internals', '--no-warnings'],
});

function main({ type, argument, version, n }) {
Expand Down

0 comments on commit 8b88d60

Please sign in to comment.