Browse Source

test(bench): remove `Throughput` from MPSC benchmarks

Because adding a throughput value to a benchmark run takes a size value,
and the size value is _not_ the variable that changes across runs in the
MPSC benchmarks (it's the number of senders), this stops Criterion for
generating line graphs in these tests. That's kind of a bummer (and
possibly worth an upstream issue...) but I think it's more useful to get
the line graph than throughput reporting, since the violin plots aren't
color-coded by implementation, making comparisons harder...
Eliza Weisman 3 years ago
parent
commit
8342ee9823
1 changed files with 1 additions and 3 deletions
  1. 1 3
      bench/benches/async_mpsc.rs

+ 1 - 3
bench/benches/async_mpsc.rs

@@ -1,4 +1,4 @@
-use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
+use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
 use tokio::{runtime, task};
 
 /// This benchmark simulates sending a bunch of strings over a channel. It's
@@ -17,7 +17,6 @@ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
 aaaaaaaaaaaaaa";
 
     const SIZE: u64 = 100;
-    group.throughput(Throughput::Elements(SIZE));
 
     for senders in [10, 50, 100] {
         group.bench_with_input(
@@ -141,7 +140,6 @@ fn bench_mpsc_integer(c: &mut Criterion) {
     let mut group = c.benchmark_group("async/mpsc_integer");
     const SIZE: u64 = 1_000;
     for senders in [10, 50, 100] {
-        group.throughput(Throughput::Elements(SIZE));
         group.bench_with_input(
             BenchmarkId::new("ThingBuf", senders),
             &senders,