diff options
author | Deokjin Kim <deokjin81.kim@gmail.com> | 2023-01-02 13:15:37 +0900 |
---|---|---|
committer | Node.js GitHub Bot <github-bot@iojs.org> | 2023-01-11 20:07:57 +0000 |
commit | a9bc3cf39bc615bfa63b5b48b61cb847fdf84c52 (patch) | |
tree | ab67a0e3b7a99241af2e4643d337a7487409c453 | |
parent | d8014f6aa9670378609bfe8e76ba045759ae0d58 (diff) | |
download | node-new-a9bc3cf39bc615bfa63b5b48b61cb847fdf84c52.tar.gz |
benchmark,tools: use os.availableParallelism()
Refs: https://github.com/nodejs/node/pull/45895
PR-URL: https://github.com/nodejs/node/pull/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>
-rw-r--r-- | benchmark/_http-benchmarkers.js | 2 | ||||
-rwxr-xr-x | tools/build-addons.mjs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js index ec0e80a9e7..e8c5ee7711 100644 --- a/benchmark/_http-benchmarkers.js +++ b/benchmark/_http-benchmarkers.js @@ -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) { diff --git a/tools/build-addons.mjs b/tools/build-addons.mjs index b0ec02d8e9..a96c18435d 100755 --- a/tools/build-addons.mjs +++ b/tools/build-addons.mjs @@ -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]; |