]> git.lizzy.rs Git - rust.git/commit
Inline functions Ordering::{then, then_with}
authorStjepan Glavina <stjepang@gmail.com>
Tue, 14 Mar 2017 13:01:01 +0000 (14:01 +0100)
committerStjepan Glavina <stjepang@gmail.com>
Tue, 14 Mar 2017 13:01:01 +0000 (14:01 +0100)
commit8af30132f14737a8d41db48aad9e78df396d8990
tree335b88758eba944137e4c847e15fa0bbbb51329d
parentfa53235cc4364fe085ccba720237d19b669c2f8b
Inline functions Ordering::{then, then_with}

@jongiddy noticed bad performance due to the lack of inlining on `then`
and `then_with`. I confirmed that inlining really is the culprit by
creating a custom `then` function and repeating his benchmark on my
machine with and without the `#[inline]` attribute.

The numbers were exactly the same on my machine without the attribute.
With `#[inline]` I got the same performance as I did with manually
inlined implementation.
src/libcore/cmp.rs