-
Notifications
You must be signed in to change notification settings - Fork 463
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
Fix Build::compile_objects
perf regression and deadlock
#849
Conversation
Fixed #844 Signed-off-by: Jiahao XU <[email protected]>
I can confirm that this fixes the performance regression that I'm experiencing at 1.0.81 |
Thank you for testing! I also wonder if it improves performance, the original PR is intended to improve performance by dramatically reducing number of threads spawned and joined. |
Well, if it does, then marginally, in some of my tests I got some times with the patch that were about half a second under the times with 1.0.79, but then again in some tests it finished in about half a second slower :) |
Thanks, I guess modern hardware are a bit too powerful. @twistedfall Can you push it to GitHub and check whether it improve CI run-time? |
Setting up CI with a custom patched |
Thank you very much! cc @thomcc This PR fixed a potential deadlock and a known performance regression. |
by using `Child::try_wait` and `mpsc::Receiver::try_recv` to wait on multiple processes and the channel concurrently, and `thread::yield_now()` if no progress is made. Signed-off-by: Jiahao XU <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for now. I will think about this more, but that should not block getting this fix to users.
@twistedfall cc v1.0.82 has released! |
Use of |
That's definitely not intended...I thought the msrv would check that, but it doesn't enable feature |
Do you plan to remove the use of |
It's a release over a year old and was unintentional, so I wouldn't fix it on my own, but I would accept a patch fixing it if it's reasonable (with no guarantee that we won't bump the MSRV again in a future release -- it would be in the relnotes next time though). Definitely the CI detection should be fixed, however. EDIT: Note that I can't promise a release of cc until the weekend though. |
@newpavlov Unfortunately I have been busy recently so I won't be able to provide a PR in a short time, however I do think it can be done even if you don't have any experience with the |
In our case |
That's good to hear, though I will submit a PR to fix this |
This reverts commit 71bf6b6. Using the parallel feature on cc requires Rust 1.61 or higher, see rust-lang/cc-rs#849
@newpavlov @thomcc I've opened #888 to fix this |
Child::try_wait
andmpsc::Receiver::try_recv
to wait onmultiple processes and the channel concurrently, and
thread::yield_now()
if no progress is made.Signed-off-by: Jiahao XU [email protected]