-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Optional parameter to increase the number of simultaneous jobs #57
Comments
The problem with that is, as always, synchronising console output. But good idea, yes. |
As I understand it, Cargo spins up a job server (I hope Makefile-compatible) that it uses to coordinate the parallel invocations of the compiler and the threads that each compiler starts. If it didn't do this, then you'd actually have It's possible that
This final step is often a memory-intensive one, as the linker is crunching lots of data. If there's many of these in parallel, I could see getting close to hitting swap.
Always a very useful thing. I'd vote for something akin to what |
Unlike running tests though it can be useful to see which crates are building in real time, not after the fact. I propose per-line buffering of outputs from each
|
Today's Cargo does this somehow, as you can see in the progress bar it shows when compiling many crates in parallel. |
Good thing you mentioned that, |
I'm willing to provide assistance to someone who wants to implement this, but it seems like a lot of work in what is already an abysmal codebase. |
One feature I've wondered about for awhile would be to have parallel update tasks running. I have a very powerful desktop, with a 8-core/16-thread R7 1700X processor. When there are half a dozen packages to be updated, a large portion of the update process is spent in a single thread during the final stages of each package. Since only one update happens at a time, these final stage processes are sequential, making the update process very slow compared to what it could be.
If I could choose to run multiple package updates in parallel, then their final, sequential stage would run in parallel, greatly reducing the time to do the updates.
My preferred approach would be to naively run the specified number of package updates in parallel, allowing the operating system to sort out who gets access to the processor, but an approach that you might find more reasonable would be to artificially restrict each package update to a fraction of the processor. With
cargo install-update -a -j4
, we could have 4 update jobs running in parallel. On a 16-thread machine, each of these 4 jobs could be run withcargo install -j4 ...
to equally divide the processor threads among the update tasks.If this were to be implemented, it would be nice to have an option or sentinel value to just start all jobs simultaneously, so I don't have to count up how many updates need to be done and supply that number to the parameter.
The text was updated successfully, but these errors were encountered: