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

Optimizing Clippy & linting #114

Open
2 tasks
nikomatsakis opened this issue Jul 22, 2024 · 10 comments
Open
2 tasks

Optimizing Clippy & linting #114

nikomatsakis opened this issue Jul 22, 2024 · 10 comments

Comments

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Jul 22, 2024

Metadata
Point of contact @blyxyas
Team(s) clippy
Goal document 2025h1/optimize-clippy-linting-2

Summary

This is the formalization and documentation of the Clippy Performance Project, a project first talked about on Zulip, July 2023. As the project consists of several points and is ever-changing, this document also has a dynamic structure and the team can add points.

In short, this is an effort to optimize Clippy, and Rust's linting infrastructure with a point of view of making Clippy faster (both on CI/CD pipelines, and on devs' machines)

Tasks and status

@blyxyas
Copy link
Member

blyxyas commented Jul 24, 2024

✔️ New medium-sized objective completed

rust-lang/rust-clippy#12830 Use ControlFlow in more places, closing rust-lang/rust-clippy#12829 Use ControlFlow in more visitors

@rust-lang rust-lang locked and limited conversation to collaborators Jul 25, 2024
@nikomatsakis
Copy link
Contributor Author

This issue is intended for status updates only.

For general questions or comments, please contact the owner(s) directly.

@blyxyas
Copy link
Member

blyxyas commented Jul 29, 2024

Key developments:

  • 1 Issue open with performance-project label ([Project Goal, Help Wanted] Optimizing MSRV attribute collection rust-clippy#13169), we've already integrated it into the project. @Alexendoo will be taking a look at it for the time being.
  • 1 performance PR merged (see above comment)
  • We're remaking our benchmarking tool (becnhv2)Our last benchmarking tool (becnh) wasn't actually benchmarking the way we would've liked. I'm currently remaking it from scratch, this time in Rust instead of Bash. See here and here for more details

What's to come:

Blockers: There are no blockers, although we need some help figuring out the main bug on rust-lang/rust#125116, explained here. Someone from the compiler team taking a look at it would be greatly appreciated

@blyxyas
Copy link
Member

blyxyas commented Sep 3, 2024

Key developments:

Blockers:
There are no blockers.

@blyxyas
Copy link
Member

blyxyas commented Oct 5, 2024

Key developments:
- GnomedDev pushed rust-lang/rust#130553, which replaced an old Clippy infrastructure with a faster one (string matching into symbol matching)
- Inspections into Clippy's type sizes and cache alignment are being started. Nothing fruitful yet, but I'm checking if there's something to be improved.
- The WIP benchmarking tool for Clippy has changed the algorithm from git based to using static source code distributions (like rustup), I'm experimenting with more possibilities.

Blockers:
There are no blockers

@blyxyas
Copy link
Member

blyxyas commented Oct 28, 2024

✔️ New large objective completed

rust-lang/rust#125116 has been merged, marking half of our goal formally done!

@blyxyas
Copy link
Member

blyxyas commented Nov 26, 2024

Key developments:

Blockers: None known.
Help wanted: Help on any issue marked with performance-project would be greatly appreciated!

@blyxyas
Copy link
Member

blyxyas commented Dec 23, 2024

Key developments:

Blockers:
Help wanted: Help on any issue marked with performance-project would be greatly appreciated! Specially rust-lang/rust-clippy#13714

@nikomatsakis nikomatsakis modified the milestones: 2024h2, 2025h1 Feb 18, 2025
@nikomatsakis
Copy link
Contributor Author

This is a continuing project goal, and the updates below this comment will be for the new period 2025h1

@blyxyas
Copy link
Member

blyxyas commented Feb 26, 2025

As a monthly update (previously posted on Zulip): We have some big progress!

  • rust-clippy#13821 has been open and is currently being reviewed. It moves the MSRV logic out of lint-individualistic attribute extraction and into Clippy-wide MSRV (with a very good optimization, taking into account that only a small percentage of crates use.

  • A Clippy-exclusive benchmarker has arrived, powered by the existing lintcheck infrastructure and perf. So it's compatible with flamegraph and other such tools. rust-clippy#14194 We can later expand this into CI or a dedicated bot.

  • As you probably know, rust#125116 has been merged, just as a reminder of how that big goal was slayed like a dragon 🐉.

We now know what functions to optimize (or, at least have a basic knowledge of where Clippy spends its time).
As some future functionality, I'd love to have a functionality to build cargo and rust with debug symbols and hook it up to Clippy, but that may be harder. It's not perfect, but it's a good start!

clippy benchmark perf.data report

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants