mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
benchmark,tools: use os.availableParallelism()
Refs: https://github.com/nodejs/node/pull/45895 PR-URL: https://github.com/nodejs/node/pull/46003 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
committed by
Node.js GitHub Bot
parent
d8014f6aa9
commit
a9bc3cf39b
@@ -65,7 +65,7 @@ class WrkBenchmarker {
|
||||
const args = [
|
||||
'-d', duration,
|
||||
'-c', options.connections,
|
||||
'-t', Math.min(options.connections, require('os').cpus().length || 8),
|
||||
'-t', Math.min(options.connections, require('os').availableParallelism() || 8),
|
||||
`${scheme}://127.0.0.1:${options.port}${options.path}`,
|
||||
];
|
||||
for (const field in options.headers) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import os from 'node:os';
|
||||
|
||||
const execFile = util.promisify(child_process.execFile);
|
||||
|
||||
const parallelization = +process.env.JOBS || os.cpus().length;
|
||||
const parallelization = +process.env.JOBS || os.availableParallelism();
|
||||
const nodeGyp = process.argv[2];
|
||||
const directory = process.argv[3];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user