Skip to content

Commit

Permalink
benchmark,tools: use os.availableParallelism()
Browse files Browse the repository at this point in the history
Refs: #45895
  • Loading branch information
deokjinkim committed Jan 11, 2023
1 parent 2747363 commit 35a551e
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
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
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 35a551e

Please sign in to comment.