Run lints in parallel using rayon
#621
Labels
C-enhancement
Category: raise the bar on expectations
E-help-wanted
Call for participation: Help is requested to fix this issue.
E-mentor
Call for participation: Mentorship is available for this issue.
At a high level,
cargo-semver-checks
is just a for-loop over a list of lints. Each lint is implemented as a query — for example, "find all public functions that used to exist in the previous version, but no longer exist in the new version."Currently, all such lint queries run sequentially. However, they are all read-only and logically independent from each other — so they could also run in parallel! Instead of a for-loop over a list of lints, we'd have a parallel-for-loop — and a ~10x speedup of checking time on most modern hardware. (The final wall-clock speedup will be somewhat smaller due to Amdahl's Law as we still have to generate rustdoc JSON, and that process is not affected by this speedup.)
Expected result
Use the
rayon
library to run lint queries over a given crate in parallel. Refactor the waycargo-semver-checks
passes data and reports progress to the user as necessary to accommodate parallel lint runs. In particular, ensure that reported timing information accurately communicates how much time is spent generating rustdoc data (serial, blocking) and how much time is spent actually running each lint (after this change, parallel across lints) — this is covered by #298.The text was updated successfully, but these errors were encountered: