mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
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:
parent
95434fbf28
commit
806a516851
|
|
@ -12,7 +12,6 @@ overrides:
|
|||
- crypto/*.js
|
||||
- http/*.js
|
||||
- http2/*.js
|
||||
- misc/*.js
|
||||
- path/*.js
|
||||
- process/*.js
|
||||
- url/*.js
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ const methods = [
|
|||
|
||||
const bench = createBenchmark(main, {
|
||||
method: methods,
|
||||
n: [1e6]
|
||||
n: [1e6],
|
||||
});
|
||||
|
||||
function usingRestAndSpread(...args) {
|
||||
|
|
|
|||
|
|
@ -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 }) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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 }) {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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(() => {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ const bench = common.createBenchmark(main, {
|
|||
'איקו״ם.ישראל.museum',
|
||||
'日本.icom.museum',
|
||||
'الأردن.icom.museum',
|
||||
]
|
||||
],
|
||||
});
|
||||
|
||||
function usingPunycode(val) {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ const util = require('util');
|
|||
|
||||
const bench = common.createBenchmark(main, {
|
||||
type: ['extend', 'assign'],
|
||||
n: [10e4]
|
||||
n: [10e4],
|
||||
});
|
||||
|
||||
function main({ n, type }) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user