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

Remove {Early,Late}LintPassObjects. #105291

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

nnethercote
Copy link
Contributor

EarlyContextAndPass wraps a single early lint pass. We aggregate multiple passes into that single pass by using EarlyLintPassObjects.

This commit removes EarlyLintPassObjects by changing EarlyContextAndPass into EarlyContextAndPasses. I.e. it just removes a level of indirection. This makes the code simpler and slightly faster.

The commit does likewise for late lints.

r? @cjgillot

`EarlyContextAndPass` wraps a single early lint pass. We aggregate
multiple passes into that single pass by using `EarlyLintPassObjects`.

This commit removes `EarlyLintPassObjects` by changing
`EarlyContextAndPass` into `EarlyContextAndPasses`. I.e. it just removes
a level of indirection. This makes the code simpler and slightly faster.

The commit does likewise for late lints.
@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 Dec 5, 2022
@nnethercote
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 5, 2022
@bors
Copy link
Contributor

bors commented Dec 5, 2022

⌛ Trying commit 8980d9a with merge 316c9f376486f235b59dad27d0675cc8e2fff2fb...

@bors
Copy link
Contributor

bors commented Dec 5, 2022

☀️ Try build successful - checks-actions
Build commit: 316c9f376486f235b59dad27d0675cc8e2fff2fb (316c9f376486f235b59dad27d0675cc8e2fff2fb)

1 similar comment
@bors
Copy link
Contributor

bors commented Dec 5, 2022

☀️ Try build successful - checks-actions
Build commit: 316c9f376486f235b59dad27d0675cc8e2fff2fb (316c9f376486f235b59dad27d0675cc8e2fff2fb)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (316c9f376486f235b59dad27d0675cc8e2fff2fb): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

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

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.3%, -0.2%] 3
Improvements ✅
(secondary)
-0.6% [-0.9%, -0.2%] 8
All ❌✅ (primary) -0.3% [-0.3%, -0.2%] 3

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.0% [-3.2%, -2.8%] 2
Improvements ✅
(secondary)
-5.5% [-5.5%, -5.5%] 1
All ❌✅ (primary) -3.0% [-3.2%, -2.8%] 2

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.3%, -1.9%] 3
All ❌✅ (primary) - - 0

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 5, 2022
@cjgillot
Copy link
Contributor

cjgillot commented Dec 5, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Dec 5, 2022

📌 Commit 8980d9a has been approved by cjgillot

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 5, 2022
@bors
Copy link
Contributor

bors commented Dec 7, 2022

⌛ Testing commit 8980d9a with merge e491d2b...

@bors
Copy link
Contributor

bors commented Dec 7, 2022

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing e491d2b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 7, 2022
@bors bors merged commit e491d2b into rust-lang:master Dec 7, 2022
@rustbot rustbot added this to the 1.67.0 milestone Dec 7, 2022
@nnethercote nnethercote deleted the remove-LintPassObjects branch December 7, 2022 06:33
@bors bors mentioned this pull request Dec 7, 2022
5 tasks
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e491d2b): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.2%, 0.5%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.7% [-1.6%, -0.3%] 4
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.5% [3.5%, 3.5%] 1
Regressions ❌
(secondary)
2.4% [2.4%, 2.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.5% [3.5%, 3.5%] 1

Cycles

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

nnethercote added a commit to nnethercote/rust that referenced this pull request Dec 11, 2022
I removed these in rust-lang#105291, and subsequently learned they are necessary
for performance.

This commit reinstates them with the new and more descriptive names
`RuntimeCombined{Early,Late}LintPass`, similar to the existing passes
like `BuiltinCombinedEarlyLintPass`. It also adds some comments,
particularly emphasising how we have ways to combine passes at both
compile-time and runtime. And it moves some comments around.
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 12, 2022
…s, r=cjgillot

Fix lint perf regressions

rust-lang#104863 caused small but widespread regressions in lint performance. I tried to improve things in rust-lang#105291 and rust-lang#105416 with minimal success, before fully understanding what caused the regression. This PR effectively reverts all of rust-lang#105291 and part of rust-lang#104863 to fix the perf regression.

r? `@cjgillot`
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
…r=cjgillot

Remove `{Early,Late}LintPassObjects`.

`EarlyContextAndPass` wraps a single early lint pass. We aggregate multiple passes into that single pass by using `EarlyLintPassObjects`.

This commit removes `EarlyLintPassObjects` by changing `EarlyContextAndPass` into `EarlyContextAndPasses`. I.e. it just removes a level of indirection. This makes the code simpler and slightly faster.

The commit does likewise for late lints.

r? `@cjgillot`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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