cargo icon indicating copy to clipboard operation
cargo copied to clipboard

Performance enhancement for `cargo clean`

Open weihanglo opened this issue 3 years ago • 1 comments

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.

weihanglo avatar Apr 10 '22 07:04 weihanglo

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

ilyapopov avatar Jul 25 '22 06:07 ilyapopov