mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01: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'],
|
||||
nFiles: [10, 100, 1000],
|
||||
count: [30],
|
||||
n: [30],
|
||||
});
|
||||
|
||||
function spawnProcess(script, bench, state) {
|
||||
const cmd = process.execPath || process.argv[0];
|
||||
while (state.finished < state.count) {
|
||||
while (state.finished < state.n) {
|
||||
const child = spawnSync(cmd, script);
|
||||
if (child.status !== 0) {
|
||||
console.log('---- STDOUT ----');
|
||||
|
|
@ -39,13 +39,13 @@ function spawnProcess(script, bench, state) {
|
|||
bench.start();
|
||||
}
|
||||
|
||||
if (state.finished === state.count) {
|
||||
bench.end(state.count);
|
||||
if (state.finished === state.n) {
|
||||
bench.end(state.n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function main({ count, script, nFiles, prefixPath }) {
|
||||
function main({ n, script, nFiles, prefixPath }) {
|
||||
script = path.resolve(__dirname, '../../', `${script}.js`);
|
||||
const optionsWithScript = [
|
||||
'--permission',
|
||||
|
|
@ -54,6 +54,6 @@ function main({ count, script, nFiles, prefixPath }) {
|
|||
script,
|
||||
];
|
||||
const warmup = 3;
|
||||
const state = { count, finished: -warmup };
|
||||
const state = { n, finished: -warmup };
|
||||
spawnProcess(optionsWithScript, bench, state);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user