From 6c69ad6d4365f70e01cc37e93411f0c2219d5469 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 4 Feb 2023 19:19:36 +0100 Subject: [PATCH] benchmark: add trailing commas in `benchmark/misc` PR-URL: https://github.com/nodejs/node/pull/46474 Reviewed-By: Moshe Atlow Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: James M Snell Reviewed-By: Darshan Sen Reviewed-By: Yagiz Nizipli --- benchmark/.eslintrc.yaml | 1 - benchmark/misc/arguments.js | 2 +- benchmark/misc/freelist.js | 4 ++-- benchmark/misc/getstringwidth.js | 6 +++--- benchmark/misc/hidestackframes.js | 4 ++-- benchmark/misc/object-property-bench.js | 2 +- benchmark/misc/print.js | 4 ++-- benchmark/misc/punycode.js | 2 +- benchmark/misc/trace.js | 8 ++++---- benchmark/misc/util-extend-vs-object-assign.js | 2 +- 10 files changed, 17 insertions(+), 18 deletions(-) diff --git a/benchmark/.eslintrc.yaml b/benchmark/.eslintrc.yaml index 814c1c621bab71..9370ad56934ea1 100644 --- a/benchmark/.eslintrc.yaml +++ b/benchmark/.eslintrc.yaml @@ -12,7 +12,6 @@ overrides: - crypto/*.js - http/*.js - http2/*.js - - misc/*.js - path/*.js - process/*.js - url/*.js diff --git a/benchmark/misc/arguments.js b/benchmark/misc/arguments.js index 39f4020b1ad20e..eb63d2e5bdea1a 100644 --- a/benchmark/misc/arguments.js +++ b/benchmark/misc/arguments.js @@ -12,7 +12,7 @@ const methods = [ const bench = createBenchmark(main, { method: methods, - n: [1e6] + n: [1e6], }); function usingRestAndSpread(...args) { diff --git a/benchmark/misc/freelist.js b/benchmark/misc/freelist.js index d03c3674fdbfac..d0d4a033cff6d3 100644 --- a/benchmark/misc/freelist.js +++ b/benchmark/misc/freelist.js @@ -3,9 +3,9 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [100000] + n: [100000], }, { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }); function main({ n }) { diff --git a/benchmark/misc/getstringwidth.js b/benchmark/misc/getstringwidth.js index 9dd4b47df7182e..3ab563ffc38b8b 100644 --- a/benchmark/misc/getstringwidth.js +++ b/benchmark/misc/getstringwidth.js @@ -4,9 +4,9 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { type: ['ascii', 'mixed', 'emojiseq', 'fullwidth'], - n: [10e4] + n: [10e4], }, { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }); function main({ n, type }) { @@ -16,7 +16,7 @@ function main({ n, type }) { ascii: 'foobar'.repeat(100), mixed: 'foo'.repeat(100) + '๐Ÿ˜€' + 'bar'.repeat(100), emojiseq: '๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ง๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ'.repeat(10), - fullwidth: 'ไฝ ๅฅฝ'.repeat(150) + fullwidth: 'ไฝ ๅฅฝ'.repeat(150), })[type]; bench.start(); diff --git a/benchmark/misc/hidestackframes.js b/benchmark/misc/hidestackframes.js index 5b14f2d95b22e2..b28be725a30969 100644 --- a/benchmark/misc/hidestackframes.js +++ b/benchmark/misc/hidestackframes.js @@ -5,9 +5,9 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { type: ['hide-stackframes-throw', 'direct-call-throw', 'hide-stackframes-noerr', 'direct-call-noerr'], - n: [10e4] + n: [10e4], }, { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }); function main({ n, type }) { diff --git a/benchmark/misc/object-property-bench.js b/benchmark/misc/object-property-bench.js index 9b33ac9a636889..acdaddca2cdf9e 100644 --- a/benchmark/misc/object-property-bench.js +++ b/benchmark/misc/object-property-bench.js @@ -6,7 +6,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { method: ['property', 'string', 'variable', 'symbol'], - n: [1e9] + n: [1e9], }); function runProperty(n) { diff --git a/benchmark/misc/print.js b/benchmark/misc/print.js index e048d22f7b76ab..55afd44c038332 100644 --- a/benchmark/misc/print.js +++ b/benchmark/misc/print.js @@ -4,7 +4,7 @@ const { spawn } = require('child_process'); const bench = common.createBenchmark(main, { dur: [1], - code: ['1', '"string"', 'process.versions', 'process'] + code: ['1', '"string"', 'process.versions', 'process'], }); function spawnProcess(code) { @@ -47,7 +47,7 @@ function start(state, code, bench, getNode) { function main({ dur, code }) { const state = { go: true, - throughput: 0 + throughput: 0, }; setTimeout(() => { diff --git a/benchmark/misc/punycode.js b/benchmark/misc/punycode.js index d0ee938ebd39a3..a4fda4168da47c 100644 --- a/benchmark/misc/punycode.js +++ b/benchmark/misc/punycode.js @@ -35,7 +35,7 @@ const bench = common.createBenchmark(main, { 'ืื™ืงื•ืดื.ื™ืฉืจืืœ.museum', 'ๆ—ฅๆœฌ.icom.museum', 'ุงู„ุฃุฑุฏู†.icom.museum', - ] + ], }); function usingPunycode(val) { diff --git a/benchmark/misc/trace.js b/benchmark/misc/trace.js index 8620e99329b224..f308232804352a 100644 --- a/benchmark/misc/trace.js +++ b/benchmark/misc/trace.js @@ -4,17 +4,17 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [100000], - method: ['trace', 'isTraceCategoryEnabled'] + method: ['trace', 'isTraceCategoryEnabled'], }, { flags: [ '--expose-internals', '--no-warnings', '--trace-event-categories', 'foo', - ] + ], }); const { - TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN: kBeforeEvent + TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN: kBeforeEvent, } = common.binding('constants').trace; function doTrace(n, trace) { @@ -37,7 +37,7 @@ function doIsTraceCategoryEnabled(n, isTraceCategoryEnabled) { function main({ n, method }) { const { trace, - isTraceCategoryEnabled + isTraceCategoryEnabled, } = common.binding('trace_events'); switch (method) { diff --git a/benchmark/misc/util-extend-vs-object-assign.js b/benchmark/misc/util-extend-vs-object-assign.js index 83aec7b9c82231..e2ac0a5417e489 100644 --- a/benchmark/misc/util-extend-vs-object-assign.js +++ b/benchmark/misc/util-extend-vs-object-assign.js @@ -5,7 +5,7 @@ const util = require('util'); const bench = common.createBenchmark(main, { type: ['extend', 'assign'], - n: [10e4] + n: [10e4], }); function main({ n, type }) {