-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
-Zthreads threads seem to try to allocate memory up front regardless of if it will actually be needed or not #117638
Comments
Backtrace
|
A simple thing would be to cap the number of threads at some number like 128 or 256. |
I was able to repeat the problem
|
Fix compiler panic with a large number of threads Hi, This PR is an attempt to fix the problem described here rust-lang#117638 using the solution suggested in this comment rust-lang#117638 (comment) Best regards, Michal
Fix compiler panic with a large number of threads Hi, This PR is an attempt to fix the problem described here rust-lang#117638 using the solution suggested in this comment rust-lang#117638 (comment) Best regards, Michal
Rollup merge of rust-lang#132355 - practicalrs:fix_117638, r=SparrowLii Fix compiler panic with a large number of threads Hi, This PR is an attempt to fix the problem described here rust-lang#117638 using the solution suggested in this comment rust-lang#117638 (comment) Best regards, Michal
We cap the threads in option parsing in #132355 so I think this can be closed now. |
I wonder if its still a worthy micro optimization to allocate threads (or whatever) more "lazily" / "on demand" in order to not do unnecessary work, or if that's too complicated architecturally |
When eventually the rustc front end automatically parallelizes without having to manually specify the In fact, it's hard to say how many threads are most appropriate in any case. I'd even like to limit the number of threads to a smaller size, since we observed that when the number of cores is large enough, the parallel front end still maintains the highest performance when the number of threads is 8 or 16. |
I tried this code:
Build with
rustc main.rs -Zthreads=999999
I expected to see this happen: explanation
Instead, this happened: explanation
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: