cargo
cargo copied to clipboard
Performance enhancement for `cargo clean`
Problem
Spinned out from https://github.com/rust-lang/cargo/pull/10236#issuecomment-1083785378
#10236 introduces a progress bar for cargo clean, which has a slight performance hit (0-10%). There are still some possibilities we can explore in this area to enhance its performance.
Proposed Solution
Two directions (and they might be entangled with each other)
- Parallelize the file removing process.
- The progress bar ticks too often, and might hurt the performance over a slow network connection.
Notes
Unless this affects people a lot, I feel like it is not a high-priority task. Anyone interested in it should discuss with the cargo team first, though due to the limited review bandwidth, the team might not respond instantly.
For historical precedent: in 2016 npm had an issue where progress bar was slowing down npm install in some cases by a factor of 2.
https://github.com/npm/npm/issues/11283