-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
rustc_metadata: Filter encoded data more aggressively using DefKind
#109765
Conversation
r? @jackh726 (rustbot has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 462c49f2301dd11b5634a8f07beb58732bbf3f9b with merge bef788b9e938a86104d5e6fd1c413440c5d305a2... |
This comment was marked as resolved.
This comment was marked as resolved.
462c49f
to
450109f
Compare
Some changes occurred in src/librustdoc/clean/types.rs cc @camelid |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 450109fe5dbfb024ad330bcfdd3f8741d0b51700 with merge c106784be1adfcb22d4ef5333f61698de37db28e... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (c106784be1adfcb22d4ef5333f61698de37db28e): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking 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 Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
|
@rustbot ready |
Binary size improvements are also nice - https://perf.rust-lang.org/compare.html?start=8a7ca936e61d04399198911ee2b07ac110bf17b0&end=c106784be1adfcb22d4ef5333f61698de37db28e&stat=size%3Alinked_artifact. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those large matches are not the easiest thing to review...
How did you determine them?
Is there any way to be certain, or should we just wait for bug reports?
@@ -21,10 +21,17 @@ error[E0223]: ambiguous associated type | |||
LL | type X = std::ops::Deref::Target; | |||
| ^^^^^^^^^^^^^^^^^^^^^^^ | |||
| | |||
help: if there were a type named `Example` that implemented `Deref`, you could use the fully-qualified path | |||
help: use the fully-qualified path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does the output change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to the compiler/rustc_hir_analysis/src/astconv/mod.rs
change.
Previously, impl visibility was used, but impl visibility is meaningless (and no longer encoded with this PR), trait visibility was actually intended there.
@@ -825,25 +825,136 @@ fn should_encode_visibility(def_kind: DefKind) -> bool { | |||
| DefKind::ForeignTy | |||
| DefKind::TraitAlias | |||
| DefKind::AssocTy | |||
| DefKind::TyParam |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only TyParam
and not LifetimeParam
and ConstParam
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some spans are only encoded for diagnostics.
Errors related to type parameters may report different diagnostics than errors related to other generic parameters.
It could make sense to drop extern spans for type parameter diagnostics too, to optimize the "good path".
Some common sense initially (named items that get into non-reexport
Wait for bug reports, I guess. |
r? @cjgillot |
This comment was marked as resolved.
This comment was marked as resolved.
450109f
to
f5a9f6f
Compare
@bors r=cjgillot |
⌛ Testing commit f5a9f6f with merge 8b0362a3b018c68c3bd176a162565249a30eb272... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (dfe024e): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
|
I focused on data that contains spans, because spans are expensive to encode/decode/hash, but also touched
should_encode_visibility
too.One incorrect use of impl visibility in diagnostics is also replaced with trait visibility.