Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use os.availableParallelism when available #5183

Merged
merged 2 commits into from
Jan 8, 2023

Conversation

merceyz
Copy link
Member

@merceyz merceyz commented Jan 7, 2023

What's the problem this PR addresses?

Node.js v19.4.0 comes with a os.availableParallelism function and to quote the docs:

os.cpus().length should not be used to calculate the amount of parallelism available to an application. Use os.availableParallelism() for this purpose.
https://nodejs.org/dist/latest-v19.x/docs/api/os.html#oscpus

How did you fix it?

Use os.availableParallelism when available.

Checklist

  • I have read the Contributing Guide.
  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@merceyz merceyz merged commit 077fc4d into master Jan 8, 2023
@merceyz merceyz deleted the merceyz/chore/availableParallelism branch January 8, 2023 01:12
@merceyz merceyz mentioned this pull request Jan 12, 2023
3 tasks
merceyz added a commit that referenced this pull request Jan 29, 2023
* chore: use `os.availableParallelism` when available

* refactor: move to nodeUtils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants