minor: re-format the `buffer.rs`

This commit is contained in:
Daniel Abramov 2022-02-03 19:12:32 +01:00
parent cd79500d25
commit 47f669dacb
1 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,5 @@
use std::io::{Cursor, Read};
use std::io::Result as IoResult;
use std::io::{Cursor, Read};
use bytes::Buf;
use criterion::*;
@ -114,8 +114,12 @@ fn benchmark(c: &mut Criterion) {
let mut group = c.benchmark_group("buffers");
group.throughput(Throughput::Bytes(STREAM_SIZE as u64));
group.bench_function("InputBuffer", |b| b.iter(|| input_buffer(black_box(stream.clone()))));
group.bench_function("ReadBuffer (stack)", |b| b.iter(|| stack_read_buffer(black_box(stream.clone()))));
group.bench_function("ReadBuffer (heap)", |b| b.iter(|| heap_read_buffer(black_box(stream.clone()))));
group.bench_function("ReadBuffer (stack)", |b| {
b.iter(|| stack_read_buffer(black_box(stream.clone())))
});
group.bench_function("ReadBuffer (heap)", |b| {
b.iter(|| heap_read_buffer(black_box(stream.clone())))
});
group.finish();
}