criterion 0.2.0

Statistics-driven micro-benchmarking library
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::mem;

use criterion::Criterion;

const SIZE: usize = 1024 * 1024;

fn dealloc(c: &mut Criterion) {
    c.bench_function("dealloc", |b| {
        b.iter_with_setup(|| (0..SIZE).map(|_| 0u8).collect::<Vec<_>>(), mem::drop)
    });
}

criterion_group!(benches, dealloc);