-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Inline <T as From<T>>::from
#100733
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
Inline <T as From<T>>::from
#100733
Conversation
I noticed in the MIR for <https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=67097e0494363ee27421a4e3bdfaf513> that it's inlined most stuff ``` scope 5 (inlined <Result<i32, u32> as Try>::branch) ``` ``` scope 8 (inlined <Result<i32, u32> as Try>::from_output) ``` But yet the do-nothing `from` call was still there: ``` _17 = <u32 as From<u32>>::from(move _18) -> bb9; ``` So let's give this a try and see what perf has to say.
This comment was marked as resolved.
This comment was marked as resolved.
r? @m-ou-se (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 8118a31 with merge a4685669c45ee36d41b7e6902366cbbee52120c4... |
☀️ Try build successful - checks-actions |
Queued a4685669c45ee36d41b7e6902366cbbee52120c4 with parent 8064a49, future comparison URL. |
Finished benchmarking commit (a4685669c45ee36d41b7e6902366cbbee52120c4): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
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 may lead to changes in compiler perf. @bors rollup=never Footnotes |
Oh! Well that's more obviously-good than I was expecting. |
Looking forward to see the day where I won't have to worry about placing |
@bors r+ This change looks fine by itself, but I'm worried about Do we have some plan forward, other than just expecting people to apply these attributes manually and benchmarking at every step? |
☀️ Test successful - checks-actions |
Finished benchmarking commit (380addd): 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.
Footnotes |
I noticed (in #100693 (comment)) that the MIR for https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=67097e0494363ee27421a4e3bdfaf513 has inlined most stuff
But yet the do-nothing
from
call was still there:So let's give this a try and see what perf has to say.