-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
remove some indirection from proc_macro_server #90876
Conversation
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 943798401d23b0dfedfa3705aa6744bf5ec6cf1f with merge 16d626fda14734fe3545bd55d283c5dd2973d0e8... |
☀️ Try build successful - checks-actions |
Queued 16d626fda14734fe3545bd55d283c5dd2973d0e8 with parent 1b12d01, future comparison URL. |
Finished benchmarking commit (16d626fda14734fe3545bd55d283c5dd2973d0e8): comparison url. Summary: This change led to large relevant mixed results 🤷 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 try perf run, please indicate this with @bors rollup=never |
Well, that appears to have changed perf counts, but for a completely different test than the regression in #87264 (comment)... |
if self.ecx.ecfg.span_debug { | ||
if self.span_debug { |
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.
I don't think this should cause any perf change, can you test it in isolation?
fn sess(&self) -> &ParseSess { | ||
self.ecx.parse_sess() | ||
} |
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.
maybe we'll get the same perf if parse_sess
and sess
are both #[inline]
?
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.
Perhaps. My reasoning here was just that it would remove some pointer chasing, as what was previously 1 indirect read (self.sess
) is now 2 (self.ecx.sess
, parse_sess
is an inline field of Session
, so doesn't require an additional pointer chase). If the functions are not being inlined, though, that's more likely to be the cause of the perf loss.
I'll push another version where I just #[inline]
the two functions.
9437984
to
e168f91
Compare
I'm guessing I don't have the permissions to ask bors to run perf tests, but I suppose it's worth a try :-) @bors try @rust-timer queue |
Insufficient permissions to issue commands to rust-timer. |
@mystor: 🔑 Insufficient privileges: not in try users |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit e168f91 with merge 412e53deb3152c35a44186f969f8334da38f3d35... |
☀️ Try build successful - checks-actions |
Queued 412e53deb3152c35a44186f969f8334da38f3d35 with parent 41301c3, future comparison URL. |
Finished benchmarking commit (412e53deb3152c35a44186f969f8334da38f3d35): comparison url. Summary: This change led to small relevant mixed results 🤷 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 try perf run, please indicate this with @bors rollup=never |
do you want to try something else here or should we just close? Doesn't seem like there is anything obvious |
Yeah I don't see anything obvious and don't have a ton of time to continue investigating right now, so closing the bug seems reasonable to me. |
This is a theoretical fix for the performance regression from #87264, based on wild guessing about what may have caused the regression. The patch reduces indirections when getting a
ParseSess
and debug-formattingSpan
s in the proc macro server.