1

Introduce `tcx.get_diagnostic_name` by camsteffen · Pull Request #89534 · rust-l...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/89534
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

New issue

Introduce tcx.get_diagnostic_name #89534

Conversation

Copy link

Contributor

camsteffen commented 16 days ago

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

Copy link

Contributor

oli-obk commented 16 days ago

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+

Copy link

Contributor

bors commented 16 days ago

pushpin Commit 76dc869 has been approved by oli-obk

Copy link

Contributor

oli-obk commented 16 days ago

@bors r-

Copy link

Contributor

oli-obk commented 16 days ago

Copy link

Collaborator

rust-timer commented 16 days ago

Awaiting bors try build completion.

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

Copy link

Contributor

bors commented 16 days ago

hourglass Trying commit 76dc869 with merge c6f2cb4408076901a5429245f87b314372eed6fc...

Copy link

Contributor

Author

camsteffen commented 16 days ago

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.

Copy link

Contributor

Author

camsteffen commented 15 days ago

@bors ping

Copy link

Contributor

bors commented 15 days ago

sleepy I'm awake I'm awake

Copy link

Contributor

Author

camsteffen commented 15 days ago

@rust-timer queue

Copy link

Collaborator

rust-timer commented 15 days ago

Awaiting bors try build completion.

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

Copy link

Contributor

Author

camsteffen commented 15 days ago

@bors try

Copy link

Contributor

bors commented 15 days ago

hourglass Trying commit 76dc869 with merge 65a46a09ff197696229f1abbd888ff7fbee2b777...

Copy link

Contributor

bors commented 15 days ago

sunny Try build successful - checks-actions
Build commit: 65a46a0 (65a46a09ff197696229f1abbd888ff7fbee2b777)

Copy link

Collaborator

rust-timer commented 15 days ago

Copy link

Collaborator

rust-timer commented 15 days ago

Finished benchmarking commit (65a46a0): comparison url.

Summary: This change led to moderate relevant mixed results shrug 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

Copy link

Contributor

bors commented 14 days ago

hourglass Trying commit b6cab80 with merge f108b65...

This comment has been hidden.

Copy link

Contributor

Author

camsteffen commented 14 days ago

Copy link

Collaborator

rust-timer commented 14 days ago

Awaiting bors try build completion.

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

Copy link

Contributor

bors commented 14 days ago

hourglass Trying commit a8d8bfd with merge 7633f3a38960dc501c2a2111fd8496abd90553ff...

Copy link

Contributor

bors commented 14 days ago

sunny Try build successful - checks-actions
Build commit: 7633f3a (7633f3a38960dc501c2a2111fd8496abd90553ff)

Copy link

Collaborator

rust-timer commented 14 days ago

Copy link

Collaborator

rust-timer commented 14 days ago

Finished benchmarking commit (7633f3a): comparison url.

Summary: This change led to large relevant improvements tada 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

Copy link

Contributor

Author

camsteffen commented 14 days ago

My first compiler perf improvement! relaxed

Copy link

Contributor

oli-obk commented 14 days ago

Very nice!

@bors r+

Copy link

Contributor

bors commented 14 days ago

pushpin Commit a8d8bfd has been approved by oli-obk

Copy link

Contributor

bors commented 14 days ago

hourglass Testing commit a8d8bfd with merge 0157cc977fd71297ce73e2f249321f5ba2555d42...

Copy link

Contributor

bors commented 13 days ago

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

Copy link

Collaborator

rust-timer commented 13 days ago

Finished benchmarking commit (0157cc9): comparison url.

Summary: This change led to large relevant mixed results shrug 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Assignees

oli-obk

Projects

None yet

Milestone

1.57.0

Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK