Skip to content

Improve incremental use of lint filtering #145220

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

blyxyas
Copy link
Member

@blyxyas blyxyas commented Aug 10, 2025

Via making the query DefId dependant instead of running on the whole crate, we can reuse the shallow lint map of previously-visited items in other runs.

Similar to the approach that would maybe help with #144927

@rustbot
Copy link
Collaborator

rustbot commented Aug 10, 2025

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 10, 2025
@blyxyas
Copy link
Member Author

blyxyas commented Aug 10, 2025

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Aug 10, 2025

⌛ Trying commit c5599e0 with merge 30964bb

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Aug 10, 2025
Improve incremental use of lint filtering
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 10, 2025

needs_to_run
}

fn lints_that_dont_need_to_run(tcx: TyCtxt<'_>, (): ()) -> UnordSet<LintId> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few ideas:

  • make the return type a dedicated struct;
  • replace dont_need_to_run.contains(lint) by a call to inherent method should_run(lint);
  • perform the check for future breakage and lint_cap in that method;
  • compute this query per module, and only recurse inside that module.

@rust-bors
Copy link

rust-bors bot commented Aug 10, 2025

☀️ Try build successful (CI)
Build commit: 30964bb (30964bb6a3917906f7a66d9ec19599520090222c, parent: 18eeac04fc5c2a4c4a8020dbdf1c652077ad0e4e)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (30964bb): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.3% [0.2%, 0.7%] 72
Regressions ❌
(secondary)
0.9% [0.1%, 3.0%] 60
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.0%] 3
All ❌✅ (primary) 0.3% [0.2%, 0.7%] 72

Max RSS (memory usage)

Results (primary 1.9%, secondary 3.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.4% [1.5%, 7.8%] 6
Regressions ❌
(secondary)
5.7% [2.2%, 12.7%] 9
Improvements ✅
(primary)
-7.2% [-7.2%, -7.2%] 1
Improvements ✅
(secondary)
-1.5% [-2.2%, -1.3%] 4
All ❌✅ (primary) 1.9% [-7.2%, 7.8%] 7

Cycles

Results (secondary -0.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.3% [2.2%, 8.4%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.8% [-7.6%, -5.9%] 2
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 462.481s -> 464.365s (0.41%)
Artifact size: 377.60 MiB -> 377.23 MiB (-0.10%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants