Skip to content
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

Run lints in parallel using rayon #621

Closed
obi1kenobi opened this issue Jan 6, 2024 · 0 comments · Fixed by #625
Closed

Run lints in parallel using rayon #621

obi1kenobi opened this issue Jan 6, 2024 · 0 comments · Fixed by #625
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.

Comments

@obi1kenobi
Copy link
Owner

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 way cargo-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.

@obi1kenobi obi1kenobi added 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. labels Jan 6, 2024
@jw013 jw013 mentioned this issue Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant