Skip to content

Commit

Permalink
benchmark: add trailing commas in benchmark/misc
Browse files Browse the repository at this point in the history
PR-URL: #46474
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
  • Loading branch information
aduh95 authored and MylesBorins committed Feb 18, 2023
1 parent 7f8b292 commit 6c69ad6
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
Expand Up @@ -12,7 +12,6 @@ overrides:
- crypto/*.js
- http/*.js
- http2/*.js
- misc/*.js
- path/*.js
- process/*.js
- url/*.js
Expand Down
2 changes: 1 addition & 1 deletion benchmark/misc/arguments.js
Expand Up @@ -12,7 +12,7 @@ const methods = [

const bench = createBenchmark(main, {
method: methods,
n: [1e6]
n: [1e6],
});

function usingRestAndSpread(...args) {
Expand Down
4 changes: 2 additions & 2 deletions benchmark/misc/freelist.js
Expand Up @@ -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 }) {
Expand Down
6 changes: 3 additions & 3 deletions benchmark/misc/getstringwidth.js
Expand Up @@ -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 }) {
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions benchmark/misc/hidestackframes.js
Expand Up @@ -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 }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/misc/object-property-bench.js
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions benchmark/misc/print.js
Expand Up @@ -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) {
Expand Down Expand Up @@ -47,7 +47,7 @@ function start(state, code, bench, getNode) {
function main({ dur, code }) {
const state = {
go: true,
throughput: 0
throughput: 0,
};

setTimeout(() => {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/misc/punycode.js
Expand Up @@ -35,7 +35,7 @@ const bench = common.createBenchmark(main, {
'איקו״ם.ישראל.museum',
'日本.icom.museum',
'الأردن.icom.museum',
]
],
});

function usingPunycode(val) {
Expand Down
8 changes: 4 additions & 4 deletions benchmark/misc/trace.js
Expand Up @@ -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) {
Expand All @@ -37,7 +37,7 @@ function doIsTraceCategoryEnabled(n, isTraceCategoryEnabled) {
function main({ n, method }) {
const {
trace,
isTraceCategoryEnabled
isTraceCategoryEnabled,
} = common.binding('trace_events');

switch (method) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/misc/util-extend-vs-object-assign.js
Expand Up @@ -5,7 +5,7 @@ const util = require('util');

const bench = common.createBenchmark(main, {
type: ['extend', 'assign'],
n: [10e4]
n: [10e4],
});

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

0 comments on commit 6c69ad6

Please sign in to comment.