-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Inline Poll
methods
#107987
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 Poll
methods
#107987
Conversation
(rustbot 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
|
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.
Seems reasonable to me: it's consistent with guidance at https://std-dev-guide.rust-lang.org/code-considerations/performance/inline.html (modulo genericness, though the map_*
methods on Option
and Result
are also #[inline]
and this isn't really any different, plus it does indeed change the inlining behaviour as per the raised issue).
@bors r+ |
…-Simulacrum Inline `Poll` methods With `opt-level="z"`, the `Poll::map*` methods are sometimes not inlined (see <https://godbolt.org/z/ca5ajKTEK>). This PR adds `#[inline]` to these methods. I have a project that can benefit from this change, but do we want to enable this behavior universally? Fixes rust-lang#101080.
☀️ Test successful - checks-actions |
Finished benchmarking commit (31f858d): 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.
CyclesThis benchmark run did not return any relevant results for this metric. |
With
opt-level="z"
, thePoll::map*
methods are sometimes not inlined (see https://godbolt.org/z/ca5ajKTEK). This PR adds#[inline]
to these methods. I have a project that can benefit from this change, but do we want to enable this behavior universally?Fixes #101080.