mirror of
https://github.com/nodejs/node.git
synced 2025-12-27 23:41:14 +00:00
benchmark: update count to n in permission startup
PR-URL: https://github.com/nodejs/node/pull/59872 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
1e008dab21
commit
43007e3e42
@ -19,12 +19,12 @@ const bench = common.createBenchmark(main, {
|
|||||||
],
|
],
|
||||||
prefixPath: ['/tmp'],
|
prefixPath: ['/tmp'],
|
||||||
nFiles: [10, 100, 1000],
|
nFiles: [10, 100, 1000],
|
||||||
count: [30],
|
n: [30],
|
||||||
});
|
});
|
||||||
|
|
||||||
function spawnProcess(script, bench, state) {
|
function spawnProcess(script, bench, state) {
|
||||||
const cmd = process.execPath || process.argv[0];
|
const cmd = process.execPath || process.argv[0];
|
||||||
while (state.finished < state.count) {
|
while (state.finished < state.n) {
|
||||||
const child = spawnSync(cmd, script);
|
const child = spawnSync(cmd, script);
|
||||||
if (child.status !== 0) {
|
if (child.status !== 0) {
|
||||||
console.log('---- STDOUT ----');
|
console.log('---- STDOUT ----');
|
||||||
@ -39,13 +39,13 @@ function spawnProcess(script, bench, state) {
|
|||||||
bench.start();
|
bench.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.finished === state.count) {
|
if (state.finished === state.n) {
|
||||||
bench.end(state.count);
|
bench.end(state.n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function main({ count, script, nFiles, prefixPath }) {
|
function main({ n, script, nFiles, prefixPath }) {
|
||||||
script = path.resolve(__dirname, '../../', `${script}.js`);
|
script = path.resolve(__dirname, '../../', `${script}.js`);
|
||||||
const optionsWithScript = [
|
const optionsWithScript = [
|
||||||
'--permission',
|
'--permission',
|
||||||
@ -54,6 +54,6 @@ function main({ count, script, nFiles, prefixPath }) {
|
|||||||
script,
|
script,
|
||||||
];
|
];
|
||||||
const warmup = 3;
|
const warmup = 3;
|
||||||
const state = { count, finished: -warmup };
|
const state = { n, finished: -warmup };
|
||||||
spawnProcess(optionsWithScript, bench, state);
|
spawnProcess(optionsWithScript, bench, state);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user