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

Compute lint levels by definition #102236

Merged
merged 17 commits into from
Oct 1, 2022

Conversation

cjgillot
Copy link
Contributor

Second attempt to #101620.

I think that I have removed the perf regression.

@rust-highfive
Copy link
Collaborator

r? @eholk

(rust-highfive has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 24, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 24, 2022
@cjgillot
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

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

bors commented Sep 24, 2022

⌛ Trying commit 84c767f38c89a9a6ac7023512744c1da175f0ccc with merge 4c9d2084bc3b3c56b4cd8dae0f12ea3740d2a9c5...

@bors
Copy link
Contributor

bors commented Sep 24, 2022

☀️ Try build successful - checks-actions
Build commit: 4c9d2084bc3b3c56b4cd8dae0f12ea3740d2a9c5 (4c9d2084bc3b3c56b4cd8dae0f12ea3740d2a9c5)

@rust-timer
Copy link
Collaborator

Queued 4c9d2084bc3b3c56b4cd8dae0f12ea3740d2a9c5 with parent bb5a016, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4c9d2084bc3b3c56b4cd8dae0f12ea3740d2a9c5): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -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.

mean1 range count2
Regressions ❌
(primary)
1.0% [0.2%, 2.6%] 24
Regressions ❌
(secondary)
1.4% [0.2%, 2.8%] 26
Improvements ✅
(primary)
-4.1% [-28.4%, -0.2%] 63
Improvements ✅
(secondary)
-1.1% [-2.3%, -0.3%] 51
All ❌✅ (primary) -2.7% [-28.4%, 2.6%] 87

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.

mean1 range count2
Regressions ❌
(primary)
0.7% [0.6%, 0.9%] 3
Regressions ❌
(secondary)
2.7% [1.8%, 3.6%] 2
Improvements ✅
(primary)
-4.3% [-10.9%, -0.9%] 25
Improvements ✅
(secondary)
-4.1% [-4.1%, -4.1%] 1
All ❌✅ (primary) -3.8% [-10.9%, 0.9%] 28

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.

mean1 range count2
Regressions ❌
(primary)
2.7% [2.3%, 3.0%] 4
Regressions ❌
(secondary)
3.2% [3.2%, 3.2%] 1
Improvements ✅
(primary)
-12.8% [-33.4%, -3.0%] 23
Improvements ✅
(secondary)
-2.4% [-2.8%, -2.1%] 2
All ❌✅ (primary) -10.5% [-33.4%, 3.0%] 27

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 24, 2022
@bors
Copy link
Contributor

bors commented Sep 25, 2022

☔ The latest upstream changes (presumably #102040) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Sep 26, 2022

☔ The latest upstream changes (presumably #101710) made this pull request unmergeable. Please resolve the merge conflicts.

@eholk
Copy link
Contributor

eholk commented Sep 27, 2022

I started to take a brief look, but I'm not familiar with this code so it'd be better for someone else to review it. Maybe Oli, since he signed off on the last version?

@bors r? @oli-obk

@rust-highfive rust-highfive assigned oli-obk and unassigned eholk Sep 27, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Sep 29, 2022

hyper and libc in incremental-unchanged mode still have regressions that look like they are due to query recomputations even though nothing changed. I'm not sure we can do much better... I worry making caching better here may have adverse effects elsewhere, but I'll leave the decision on what to do to you, we can definitely merge this, as it massively improves the "normal" case (something got modified). I'll give the code another review now

Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

impl seems good to me. Modulo a comment or a fix of the perf, r=me

compiler/rustc_lint/src/levels.rs Show resolved Hide resolved
}
}

impl<'tcx> intravisit::Visitor<'tcx> for LintLevelsBuilder<'_, QueryMapExpectationsWrapper<'tcx>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

it's a bit hard to review the details here since it was moved around. Either move back or lmk if this is just a code move and not actually a functional change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did what I could to separate the code motion from the functional change there.

@cjgillot cjgillot force-pushed the compute_lint_levels_by_def branch 2 times, most recently from 2268c93 to a64bb3f Compare September 29, 2022 19:21
@cjgillot
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 29, 2022
@cjgillot
Copy link
Contributor Author

cjgillot commented Oct 1, 2022

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Oct 1, 2022

📌 Commit fec53fd has been approved by oli-obk

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 1, 2022
@bors
Copy link
Contributor

bors commented Oct 1, 2022

⌛ Testing commit fec53fd with merge 57f097e...

@bors
Copy link
Contributor

bors commented Oct 1, 2022

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 57f097e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 1, 2022
@bors bors merged commit 57f097e into rust-lang:master Oct 1, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 1, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (57f097e): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

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

mean1 range count2
Regressions ❌
(primary)
0.6% [0.3%, 0.9%] 14
Regressions ❌
(secondary)
1.0% [0.2%, 2.0%] 20
Improvements ✅
(primary)
-3.2% [-30.2%, -0.2%] 84
Improvements ✅
(secondary)
-1.1% [-2.8%, -0.3%] 52
All ❌✅ (primary) -2.7% [-30.2%, 0.9%] 98

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.

mean1 range count2
Regressions ❌
(primary)
0.6% [0.6%, 0.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.2% [-11.1%, -0.9%] 27
Improvements ✅
(secondary)
-2.6% [-2.9%, -2.2%] 2
All ❌✅ (primary) -4.0% [-11.1%, 0.6%] 28

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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.8% [2.0%, 3.6%] 14
Improvements ✅
(primary)
-13.4% [-35.0%, -3.3%] 22
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -13.4% [-35.0%, -3.3%] 22

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@cjgillot cjgillot deleted the compute_lint_levels_by_def branch October 2, 2022 08:51
@pnkfelix
Copy link
Member

pnkfelix commented Oct 5, 2022

If I understand the description inherited from #101620, this was an important step for making incremental compilation apply to a much broader set of input code. And the performance gains reported by perf (e.g. Twenty primary incr-patched scenarios are seeing improvements of 4% or more) seem well worth the cost that it registered.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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.

9 participants