From 9f2b81d02d891ab3d7739ccd733c2963163bdbc8 Mon Sep 17 00:00:00 2001 From: Moritz Hoffmann Date: Mon, 6 Mar 2023 21:06:17 -0500 Subject: [PATCH] Inline give for Buffer 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 --- timely/src/dataflow/channels/pushers/buffer.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/timely/src/dataflow/channels/pushers/buffer.rs b/timely/src/dataflow/channels/pushers/buffer.rs index 6f92dabb0..44079f7a8 100644 --- a/timely/src/dataflow/channels/pushers/buffer.rs +++ b/timely/src/dataflow/channels/pushers/buffer.rs @@ -81,6 +81,7 @@ impl>> BufferCore where T: Eq impl>> Buffer 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::() { let to_reserve = crate::container::buffer::default_capacity::() - self.buffer.capacity();