use criterion::{criterion_group, criterion_main, Criterion}; use hittekaart::{gpx, renderer}; static BENCH_DATA: &str = include_str!("bench.gpx"); pub fn criterion_benchmark(c: &mut Criterion) { c.bench_function("extract_from_str", |b| { b.iter(|| gpx::extract_from_str(BENCH_DATA).unwrap()) }); let data = vec![gpx::extract_from_str(BENCH_DATA).unwrap()]; c.bench_function("render_heatcounter", |b| { b.iter(|| renderer::render_heatcounter(19, &data, |_| ())); }); } criterion_group!(benches, criterion_benchmark); criterion_main!(benches);