benchmark: add trailing commas in benchmark/misc

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Antoine du Hamel 2023-02-04 19:19:36 +01:00 committed by GitHub
parent 95434fbf28
commit 806a516851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 17 additions and 18 deletions

View File

@ -12,7 +12,6 @@ overrides:
- crypto/*.js
- http/*.js
- http2/*.js
- misc/*.js
- path/*.js
- process/*.js
- url/*.js

View File

@ -12,7 +12,7 @@ const methods = [
const bench = createBenchmark(main, {
method: methods,
n: [1e6]
n: [1e6],
});
function usingRestAndSpread(...args) {

View File

@ -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 }) {

View File

@ -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();

View File

@ -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 }) {

View File

@ -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) {

View File

@ -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(() => {

View File

@ -35,7 +35,7 @@ const bench = common.createBenchmark(main, {
'איקו״ם.ישראל.museum',
'日本.icom.museum',
'الأردن.icom.museum',
]
],
});
function usingPunycode(val) {

View File

@ -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) {

View File

@ -5,7 +5,7 @@ const util = require('util');
const bench = common.createBenchmark(main, {
type: ['extend', 'assign'],
n: [10e4]
n: [10e4],
});
function main({ n, type }) {