-
Notifications
You must be signed in to change notification settings - Fork 1.7k
tests: default to more threads for ui-tests #8451
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
Conversation
Benchmarks (tested on i5-7200U, 2 core 4 threads) ``` master branch: cargo test // prime caches cargo --color=always test 70,39s user 21,91s system 180% cpu 51,035 total cargo --color=always test 70,77s user 22,13s system 180% cpu 51,579 total cargo --color=always test 70,97s user 22,12s system 180% cpu 51,673 total cargo --color=always nextest run 78,74s user 22,27s system 220% cpu 45,829 total cargo --color=always nextest run 78,46s user 21,92s system 224% cpu 44,674 total cargo --color=always nextest run 78,31s user 22,21s system 228% cpu 43,909 total Patched (ui_speedup branch) cargo test // prime cache cargo --color=always test 97,51s user 32,02s system 288% cpu 44,905 total cargo --color=always test 99,19s user 31,91s system 276% cpu 47,436 total cargo --color=always test 98,47s user 31,84s system 284% cpu 45,744 total cargo --color=always nextest run 102,18s user 30,80s system 350% cpu 37,902 total cargo --color=always nextest run 99,75s user 29,86s system 350% cpu 36,935 total cargo --color=always nextest run 100,36s user 29,93s system 351% cpu 37,061 total ```
r? @llogiq (rust-highfive has picked a reviewer for you, use r? to override) |
I worry that this may increase the global load on the system to the point where it outweighs any time savings. Our jobs are not alone on the CI machines and someone has to pay for the cycles. Given this, I don't feel confident r+ing this. @rustbot label +S-needs-discussion |
Hm, I would expect the host container to have some mechanism to limit the number of threads that get assigned to some arbitrary limit. Otherwise everyone would just I mostly had users testing locally in mind, I only noticed it while running tests locally while glancing at htop and there I still had some headroom in my cpu utilization which is fixed by this change. |
GitHub actions has a limited amount of cores. This may be higher for the Rust org, but I would be surprised if there wasn't a limit at all. You could check how many threads we have available by temporary adding a step to the CI calling So I'm not concerned that this will destroy the CI. Though even for the local user, using all available threads by default might be a bad idea. So I would limit the default to just half of the available threads, if we should go for parallel-by-default. |
For the record, the behaviour of launching $threads amount of jobs instead of $cores amount of jobs is also in line with how cargo does it when launching rustc compiler jobs. |
That's true. I see a speedup of |
oh wow, didn't think it would have that much of an impact with more cores! (also reminds me to get a faster machine 😭) |
I just tried running it on our server with 40 cores (12 were 100% in use, so effectively 28 cores) at work. I only got a speedup of Ah I just realized: compile-test already uses #cores, but this PR forces it to use #threads instead? |
I worry mostly about the effect on other tenants on the system, but that may be misguided. In any event, 10% wall time will add up, so I'm not exactly opposed to the PR. |
Ah right, |
As per our last meeting, @bors r+. |
@bors r=llogiq Is bors awake? |
📌 Commit a89c795 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
…o get thread count removes the dependency added in rust-lang#8451
…o get thread count removes the dependency added in rust-lang#8451
tests: use std::thread::available_parallelism() instead of num_cpus to get thread count removes the dependency added in #8451 --- *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: tests: use std::thread::available_parallelism() instead of num_cpus to get thread count
…o get thread count removes the dependency added in rust-lang#8451
Benchmarks (tested on i5-7200U, 2 cores, 4 threads)
changelog: use more threads for running clippys ui-tests for ~10% walltime speedup