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

Introduce tcx.get_diagnostic_name #89534

Merged
merged 3 commits into from Oct 7, 2021
Merged

Conversation

camsteffen
Copy link
Contributor

Introduces a "reverse lookup" for diagnostic items. This is mainly intended for @rust-lang/clippy which often does a long series of is_diagnostic_item calls for the same DefId.

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 4, 2021
@oli-obk
Copy link
Contributor

oli-obk commented Oct 5, 2021

Nice!

Two (not really important things):

  • do we want to get rid of is_diagnostic_item, to nudge ppl to using one of the other two functions?
  • it may be good from an API perspective to make the fields private and add a setter that inserts into both at the same time.

But these don't need to happen, let's get this rolling first and update clippy and stuff.

@bors r+

@bors
Copy link
Contributor

bors commented Oct 5, 2021

📌 Commit 76dc8699a5446753b21873b938f696ecd6571bc7 has been approved by oli-obk

@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 Oct 5, 2021
@oli-obk
Copy link
Contributor

oli-obk commented Oct 5, 2021

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 5, 2021
@oli-obk
Copy link
Contributor

oli-obk commented Oct 5, 2021

@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 Oct 5, 2021
@bors
Copy link
Contributor

bors commented Oct 5, 2021

⌛ Trying commit 76dc8699a5446753b21873b938f696ecd6571bc7 with merge c6f2cb4408076901a5429245f87b314372eed6fc...

@camsteffen
Copy link
Contributor Author

do we want to get rid of is_diagnostic_item, to nudge ppl to using one of the other two functions?

I think is_diagnostic_item will still be useful for a lot of cases.

it may be good from an API perspective to make the fields private and add a setter that inserts into both at the same time

I didn't do this because we only observe the insert return value for one of the maps, so putting an API layer there feels a little weird. And we only insert in one place.

@camsteffen
Copy link
Contributor Author

@bors ping

@bors
Copy link
Contributor

bors commented Oct 5, 2021

😪 I'm awake I'm awake

@camsteffen
Copy link
Contributor Author

@rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

@camsteffen
Copy link
Contributor Author

@bors try

@bors
Copy link
Contributor

bors commented Oct 5, 2021

⌛ Trying commit 76dc8699a5446753b21873b938f696ecd6571bc7 with merge 65a46a09ff197696229f1abbd888ff7fbee2b777...

@bors
Copy link
Contributor

bors commented Oct 5, 2021

☀️ Try build successful - checks-actions
Build commit: 65a46a09ff197696229f1abbd888ff7fbee2b777 (65a46a09ff197696229f1abbd888ff7fbee2b777)

@rust-timer
Copy link
Collaborator

Queued 65a46a09ff197696229f1abbd888ff7fbee2b777 with parent 55111d6, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (65a46a09ff197696229f1abbd888ff7fbee2b777): comparison url.

Summary: This change led to moderate relevant mixed results 🤷 in compiler performance.

  • Moderate improvement in instruction counts (up to -3.0% on incr-full builds of ctfe-stress-4)
  • Small regression in instruction counts (up to 0.6% on incr-unchanged builds of helloworld)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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 led 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

@rustbot rustbot added perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 5, 2021
@bors
Copy link
Contributor

bors commented Oct 6, 2021

⌛ Trying commit b6cab80 with merge f108b6525490526153b5efa677b3ecfc9ac2ea71...

@rust-log-analyzer

This comment has been minimized.

@camsteffen
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

@bors
Copy link
Contributor

bors commented Oct 6, 2021

⌛ Trying commit a8d8bfd with merge 7633f3a38960dc501c2a2111fd8496abd90553ff...

@bors
Copy link
Contributor

bors commented Oct 6, 2021

☀️ Try build successful - checks-actions
Build commit: 7633f3a38960dc501c2a2111fd8496abd90553ff (7633f3a38960dc501c2a2111fd8496abd90553ff)

@rust-timer
Copy link
Collaborator

Queued 7633f3a38960dc501c2a2111fd8496abd90553ff with parent d7539a6, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7633f3a38960dc501c2a2111fd8496abd90553ff): comparison url.

Summary: This change led to large relevant improvements 🎉 in compiler performance.

  • Large improvement in instruction counts (up to -3.4% on incr-full builds of ctfe-stress-4)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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 led to changes in compiler perf.

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Oct 6, 2021
@camsteffen
Copy link
Contributor Author

My first compiler perf improvement! ☺️

@oli-obk
Copy link
Contributor

oli-obk commented Oct 7, 2021

Very nice!

@bors r+

@bors
Copy link
Contributor

bors commented Oct 7, 2021

📌 Commit a8d8bfd has been approved by oli-obk

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

bors commented Oct 7, 2021

⌛ Testing commit a8d8bfd with merge 0157cc9...

@bors
Copy link
Contributor

bors commented Oct 7, 2021

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 7, 2021
@bors bors merged commit 0157cc9 into rust-lang:master Oct 7, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 7, 2021
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0157cc9): comparison url.

Summary: This change led to large relevant mixed results 🤷 in compiler performance.

  • Large improvement in instruction counts (up to -3.4% on incr-full builds of ctfe-stress-4)
  • Small regression in instruction counts (up to 0.4% on incr-unchanged builds of helloworld)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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

@rustbot rustbot added the perf-regression Performance regression. label Oct 7, 2021
@camsteffen camsteffen deleted the diag-name branch October 7, 2021 19:05
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. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants