Skip to content

Commit

Permalink
Inline give for Buffer (#511)
Browse files Browse the repository at this point in the history
This fixes a regression introduced by #426 where BufferCore::give now
lacked the inline annotation. In pingpong, this changes the runtime as
follows:

Without inline:
target/release/examples/pingpong 1 500000000 -w1  2.45s user 0.00s system 99% cpu 2.446 total

With inline:
target/release/examples/pingpong 1 500000000 -w1  1.75s user 0.00s system 99% cpu 1.755 total

Signed-off-by: Moritz Hoffmann <antiguru@gmail.com>
  • Loading branch information
antiguru authored Mar 7, 2023
1 parent 9a355e6 commit 8af9467
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions timely/src/dataflow/channels/pushers/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ impl<T, C: Container, P: Push<BundleCore<T, C>>> BufferCore<T, C, P> where T: Eq

impl<T, D: Data, P: Push<Bundle<T, D>>> Buffer<T, D, P> where T: Eq+Clone {
// internal method for use by `Session`.
#[inline]
fn give(&mut self, data: D) {
if self.buffer.capacity() < crate::container::buffer::default_capacity::<D>() {
let to_reserve = crate::container::buffer::default_capacity::<D>() - self.buffer.capacity();
Expand Down

0 comments on commit 8af9467

Please sign in to comment.