Skip to content

Commit

Permalink
Add benchmarks for bounded queues (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
notgull authored Aug 24, 2022
1 parent d3bf5a5 commit 9553e6f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ macro_rules! bench_all(
let q = ConcurrentQueue::unbounded();
$f::<T>(black_box(&q), black_box(&q));
}));

let name = format!("bounded_{}_{}", stringify!($f), type_name::<T>());

c.bench_function(&name, |b| b.iter(|| {
let q = ConcurrentQueue::bounded(THREADS * COUNT);
$f::<T>(black_box(&q), black_box(&q));
}));
}
helper::<u8>(c);
helper::<u16>(c);
Expand Down

0 comments on commit 9553e6f

Please sign in to comment.