Introduce `tcx.get_diagnostic_name` by camsteffen · Pull Request #89534 · rust-l...
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.
New issue
Introduce tcx.get_diagnostic_name
#89534
Conversation
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
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+
Commit 76dc869 has been approved by oli-obk
@bors r-
Awaiting bors try build completion.
@rustbot label: +S-waiting-on-perf
Trying commit 76dc869 with merge c6f2cb4408076901a5429245f87b314372eed6fc...
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.
@bors ping
I'm awake I'm awake
@rust-timer queue
Awaiting bors try build completion.
@rustbot label: +S-waiting-on-perf
@bors try
Trying commit 76dc869 with merge 65a46a09ff197696229f1abbd888ff7fbee2b777...
Try build successful - checks-actions
Build commit: 65a46a0 (65a46a09ff197696229f1abbd888ff7fbee2b777
)
Finished benchmarking commit (65a46a0): 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 ofctfe-stress-4
) - Small regression in instruction counts (up to 0.6% on
incr-unchanged
builds ofhelloworld
)
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
This comment has been hidden.
Awaiting bors try build completion.
@rustbot label: +S-waiting-on-perf
Trying commit a8d8bfd with merge 7633f3a38960dc501c2a2111fd8496abd90553ff...
Try build successful - checks-actions
Build commit: 7633f3a (7633f3a38960dc501c2a2111fd8496abd90553ff
)
Finished benchmarking commit (7633f3a): 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 ofctfe-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
My first compiler perf improvement!
Very nice!
@bors r+
Commit a8d8bfd has been approved by oli-obk
Testing commit a8d8bfd with merge 0157cc977fd71297ce73e2f249321f5ba2555d42...
Test successful - checks-actions
Approved by: oli-obk
Pushing 0157cc9 to master...
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 ofctfe-stress-4
) - Small regression in instruction counts (up to 0.4% on
incr-unchanged
builds ofhelloworld
)
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
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK