Add benchmarks for bounded queues (#24)

This commit is contained in:
John Nunley 2022-08-24 10:09:34 -07:00 committed by GitHub
parent d3bf5a5424
commit 9553e6fa92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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);