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.
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.