Remove datagram benchmarks

These don't make sense when sending always succeeds immediately. They should
return as a stand-alone benchmark that measures the number *received*.
This commit is contained in:
Benjamin Saunders
2019-12-09 09:33:06 -08:00
committed by Dirkjan Ochtman
parent 07e1f33805
commit 875de9f282
-34
View File
@@ -66,40 +66,6 @@ fn throughput(c: &mut Criterion) {
thread.join().unwrap();
}
{
let (addr, thread) = ctx.spawn_server();
let (client, mut runtime, handle) = ctx.make_client(addr);
let data = Bytes::from(&[0xAB; 1][..]);
group.throughput(Throughput::Elements(1));
group.bench_function("small datagrams", |b| {
b.iter(|| {
runtime.block_on(async {
client.send_datagram(data.clone()).unwrap();
});
})
});
drop(client);
runtime.block_on(handle).unwrap();
thread.join().unwrap();
}
{
let (addr, thread) = ctx.spawn_server();
let (client, mut runtime, handle) = ctx.make_client(addr);
let data = Bytes::from(&[0xAB; 1182][..]);
group.throughput(Throughput::Bytes(data.len() as u64));
group.bench_function("medium datagrams", |b| {
b.iter(|| {
runtime.block_on(async {
client.send_datagram(data.clone()).unwrap();
});
})
});
drop(client);
runtime.block_on(handle).unwrap();
thread.join().unwrap();
}
group.finish();
}