Skip to content

Commit e1c56ec

Browse files
deokjinkimRafaelGSS
authored andcommitted
benchmark,tools: use os.availableParallelism()
Refs: #45895 PR-URL: #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>
1 parent 6e2f722 commit e1c56ec

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

benchmark/_http-benchmarkers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class WrkBenchmarker {
6565
const args = [
6666
'-d', duration,
6767
'-c', options.connections,
68-
'-t', Math.min(options.connections, require('os').cpus().length || 8),
68+
'-t', Math.min(options.connections, require('os').availableParallelism() || 8),
6969
`${scheme}://127.0.0.1:${options.port}${options.path}`,
7070
];
7171
for (const field in options.headers) {

tools/build-addons.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import os from 'node:os';
1111

1212
const execFile = util.promisify(child_process.execFile);
1313

14-
const parallelization = +process.env.JOBS || os.cpus().length;
14+
const parallelization = +process.env.JOBS || os.availableParallelism();
1515
const nodeGyp = process.argv[2];
1616
const directory = process.argv[3];
1717

0 commit comments

Comments
 (0)