Skip to content

Commit 35a551e

Browse files
committed
benchmark,tools: use os.availableParallelism()
Refs: nodejs/node#45895
1 parent 2747363 commit 35a551e

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)