-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add #[inline] to the Into for From impl #109546
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
I think the concern is that because of bottom-up inlining, Unless the MIR inliner changes the decision here, I'm not sure we want to do this. |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 5f57df852125462741d6e29ab5d7e349f532f27f with merge 4a30962485784277f1078c279246fa2925a3ef67... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (4a30962485784277f1078c279246fa2925a3ef67): comparison URL. Overall result: ❌✅ regressions and improvements - 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @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.
|
I'm somewhat inclined to accept this despite that logic. My reasoning is basically:
|
Yeah, I think MIR optimizations really confuse this sort of consideration. Without any Should we try just |
Sure. |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 9bc06ffeb24baa44e7ab003ed691a42fc69eb3e0 with merge 3a40dc8f94334627847ad5dbcf56872324975ddb... |
That's not exactly how MIR inliner works. The MIR inliner works on polymorphic MIR. In this PR, it would try to inline I don't know enough of LLVM inlining to discuss it. |
☀️ Try build successful - checks-actions |
1 similar comment
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (3a40dc8f94334627847ad5dbcf56872324975ddb): comparison URL. Overall result: ❌✅ regressions and improvements - 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @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.
|
Those results look great 🚀 The PR is showing r=me without the submodule change. (Though I hope we one day get a compiler feature that we don't need to put all these |
It was not intentional, oops. (I can't approve on rust-lang/rust) I agree with your general point. In this particular case, #109247 would probably have taken care of this, but it is blocked by an issue I don't know how to debug. |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (24a69af): 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 was skimming through the standard library MIR and I noticed a handful of very suspicious
Into::into
calls inalloc
.Since this is a trivial wrapper function,#[inline(always)]
seems appropriate.;#[inline]
works too and is a lot less spooky.r? @thomcc