1use criterion::{criterion_group, Criterion};
2
3const SIZE: usize = 1024 * 1024;
4
5fn setup(c: &mut Criterion) {
6 c.bench_function("iter_with_setup", |b| {
7 b.iter_with_setup(|| (0..SIZE).map(|i| i as u8).collect::<Vec<_>>(), |v| v)
8 });
9}
10
11criterion_group!(benches, setup);
12