Skip to content

Commit

Permalink
benchmark,tools: use os.availableParallelism()
Browse files Browse the repository at this point in the history
Refs: nodejs#45895
PR-URL: nodejs#46003
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
  • Loading branch information
deokjinkim authored and RafaelGSS committed Jan 17, 2023
1 parent 897daf9 commit b041e8d
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 b041e8d

Please sign in to comment.