use criterion::{criterion_group, criterion_main, Criterion}; use hittekaart::{ gpx, renderer::{self, heatmap}, }; 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::prepare::(19, &data, || Ok(()))); }); } criterion_group!(benches, criterion_benchmark); criterion_main!(benches);