-
Notifications
You must be signed in to change notification settings - Fork 13k
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
[debuginfo] Emit associated type bindings in trait object type names. #87153
[debuginfo] Emit associated type bindings in trait object type names. #87153
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
r? @ghost |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 2e51462552a7c6255d83c22bbc040d63f7b231bb with merge 4ae522214b1d4d553b48707b8400f2b22a2ec4a2... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
2e51462
to
8fa22dd
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 8fa22dd with merge 585e91c718b0b2c5319e1fffd0ff1e62aaf7ccc2... |
☀️ Try build successful - checks-actions |
Queued 585e91c718b0b2c5319e1fffd0ff1e62aaf7ccc2 with parent b919797, future comparison URL. |
Finished benchmarking try commit (585e91c718b0b2c5319e1fffd0ff1e62aaf7ccc2): comparison url. Summary: This change led to significant regressions 😿 in compiler performance.
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 perf run, please indicate this with @bors rollup=never |
⌛ Testing commit 55820a340ce2a8a98d125b113f28a53037f25d69 with merge a1d2ba9f68b4be6d4ed7c2064a0fce42fc7550f9... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
55820a3
to
1757542
Compare
@bors r=wesleywiser |
📌 Commit 17575427abcfcc044dbefb36ac0ab1c3431d9ac9 has been approved by |
⌛ Testing commit 17575427abcfcc044dbefb36ac0ab1c3431d9ac9 with merge c8f87beb0908293dabbbe73d7c7818b556dd891a... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
…ginfo type names.
1757542
to
5b1bfae
Compare
@bors r=wesleywiser |
📌 Commit 5b1bfae has been approved by |
☀️ Test successful - checks-actions |
Given the comments on how one might address this performance issue, and the fact that it doesn't seem to have caused performance regressions after merging, I'm going to add the @rustbot label +perf-regression-triaged |
This PR updates debuginfo type name generation for trait objects to include associated type bindings and auto trait bounds -- so that, for example, the debuginfo type name of
&dyn Iterator<Item=Foo>
and&dyn Iterator<Item=Bar>
don't both map to just&dyn Iterator
anymore.The following table shows examples of debuginfo type names before and after the PR:
&dyn Iterator<Item=u32>>
&dyn Iterator
&dyn Iterator<Item=u32>
&(dyn Iterator<Item=u32>> + Sync)
&dyn Iterator
&(dyn Iterator<Item=u32> + Sync)
&(dyn SomeTrait<bool, i8, Bar=u32>> + Send)
&dyn SomeTrait<bool, i8>
&(dyn SomeTrait<bool, i8, Bar=u32>> + Send)
For targets that need C++-like type names, we use
assoc$<Item,u32>
instead ofItem=u32
:&dyn Iterator<Item=u32>>
ref$<dyn$<Iterator> >
ref$<dyn$<Iterator<assoc$<Item,u32> > > >
&(dyn Iterator<Item=u32>> + Sync)
ref$<dyn$<Iterator> >
ref$<dyn$<Iterator<assoc$<Item,u32> >,Sync> >
&(dyn SomeTrait<bool, i8, Bar=u32>> + Send)
ref$<dyn$<SomeTrait<bool, i8> > >
ref$<dyn$<SomeTrait<bool,i8,assoc$<Bar,u32> > >,Send> >
The PR also adds self-profiling measurements for debuginfo type name generation (re. #86431). It looks like the compiler spends up to 0.5% of its time in that task, so the potential for optimizing it via caching seems limited.
However, the perf run also shows the biggest regression in a test case that does not even invoke the code in question. This suggests that the length of the names we generate here can affect performance by influencing how much data the linker has to copy around.
Fixes #86134.