Skip to content

Commit

Permalink
exchange_bench: Input data as batch
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Hoffmann <antiguru@gmail.com>
  • Loading branch information
antiguru committed Nov 20, 2021
1 parent 92ca760 commit fa63c3a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions experiments/benches/exchange_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ fn experiment_exchange(
let mut time = 0;
let timer = Instant::now();

let buffer = (0..batch).collect();
let mut copy = Vec::new();

for _round in 0..rounds {
for i in 0..batch {
input.send(i);
}
copy.clone_from(&buffer);
input.send_batch(&mut copy);
copy.clear();
time += 1;
input.advance_to(time);
while probe.less_than(input.time()) {
Expand Down

0 comments on commit fa63c3a

Please sign in to comment.