+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

chore: Replace num_cpus crate with std call #3163

Merged
merged 2 commits into from
Sep 7, 2022
Merged

Conversation

MichaReiser
Copy link
Contributor

Use std::thread::available_parallelism() over num_cpus in xtask coverage

Test Plan

xtask coverage

@MichaReiser MichaReiser requested a review from a team September 6, 2022 12:06
@netlify
Copy link

netlify bot commented Sep 6, 2022

Deploy Preview for rometools ready!

Name Link
🔨 Latest commit c75106e
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/631845129606b800088f42bd
😎 Deploy Preview https://deploy-preview-3163--rometools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented Sep 6, 2022

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 45879 45879 0
Passed 44939 44939 0
Failed 940 940 0
Panics 0 0 0
Coverage 97.95% 97.95% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 39 39 0
Passed 36 36 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.31% 92.31% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5946 5946 0
Passed 1621 1621 0
Failed 4325 4325 0
Panics 0 0 0
Coverage 27.26% 27.26% 0.00%

ts/babel

Test result main count This PR count Difference
Total 588 588 0
Passed 519 519 0
Failed 69 69 0
Panics 0 0 0
Coverage 88.27% 88.27% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 16257 16257 0
Passed 12397 12397 0
Failed 3860 3860 0
Panics 0 0 0
Coverage 76.26% 76.26% 0.00%

pool: &yastl::Pool::new(
std::thread::available_parallelism()
.map_or(2, |num| usize::from(num))
.max(2),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use max as limit, is it possible to just use map?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The max is required so that we still spawn at least two threads if available_parallelism returns 1 because the testing framework has one "orchestration" thread and at least one to run the tests.

Use `std::thread::available_parallelism()` over `num_cpus`
@MichaReiser MichaReiser force-pushed the chore/remove-num-cpus branch from bd23de2 to c75106e Compare September 7, 2022 07:15
@MichaReiser MichaReiser merged commit 6e717fd into main Sep 7, 2022
@MichaReiser MichaReiser deleted the chore/remove-num-cpus branch September 7, 2022 07:29
ematipico pushed a commit that referenced this pull request Sep 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载