Skip to content

Commit

Permalink
benchmark,tools: use os.availableParallelism()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
deokjinkim authored and juanarbol committed Jan 31, 2023
1 parent 257224d commit ed1ac82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion benchmark/_http-benchmarkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tools/build-addons.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit ed1ac82

Please sign in to comment.