-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 trivial functions on core::sync::Exclusive
#102167
Conversation
r? @scottmcm (rust-highfive has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
Sure, this seems fine. @bors r+ rollup=iffy
Note that inlining is bottom-up, not top-down, so this encourages the whole thing to be inlined into the caller, including the inner poll if the inner poll was already inlined into it. But if the inner poll is big it probably won't be, and then it makes sense again for this one to inline 🤷 |
This is why I called it out as slightly dodgier than the others, but I don't think it will make a difference. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (cdb76db): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. 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 |
Why are we not doing |
Add `#[inline]` to trivial functions on `core::sync::Exclusive` When optimizing for size things like these sometimes don't inlined even though they're generic. This is bad because they're no-ops. Only dodgy one is poll I guess since it forwards to the inner poll, but it's not like we're doing `#[inline(always)]` here.
Add `#[inline]` to trivial functions on `core::sync::Exclusive` When optimizing for size things like these sometimes don't inlined even though they're generic. This is bad because they're no-ops. Only dodgy one is poll I guess since it forwards to the inner poll, but it's not like we're doing `#[inline(always)]` here.
When optimizing for size things like these sometimes don't inlined even though they're generic. This is bad because they're no-ops.
Only dodgy one is poll I guess since it forwards to the inner poll, but it's not like we're doing
#[inline(always)]
here.