rainbow-rs/benches/sbocco.rs

22 lines
650 B
Rust
Raw Normal View History

2018-09-20 17:27:02 +02:00
#[macro_use]
extern crate criterion;
2018-09-28 16:58:46 +02:00
extern crate rainbowcazzi;
2018-09-20 17:27:02 +02:00
use criterion::Criterion;
use rainbowcazzi::rainbow;
2018-09-28 18:41:29 +02:00
use std::fs::File;
2018-09-20 17:27:02 +02:00
fn criterion_benchmark(c: &mut Criterion) {
2018-09-28 18:41:29 +02:00
let infile = File::open("assets/sbocchino").unwrap();
c.bench_function("sbocchino", |b| b.iter(|| rainbow(&infile, true)));
let infile = File::open("assets/sbocco").unwrap();
c.bench_function("sbocco", |b| b.iter(|| rainbow(&infile, true)));
let infile = File::open("assets/sboccone").unwrap();
c.bench_function("sbocchino", |b| b.iter(|| rainbow(&infile, true)));
2018-09-20 17:27:02 +02:00
}
criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);