From f3cfe67d41845cdd0e5711fc6c57aa3352bc3c46 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 4 May 2022 13:39:29 -0400 Subject: [PATCH] update some benchmark info --- benchmarks/src/lib.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/benchmarks/src/lib.rs b/benchmarks/src/lib.rs index d091d3c..97a4384 100644 --- a/benchmarks/src/lib.rs +++ b/benchmarks/src/lib.rs @@ -53,13 +53,17 @@ impl<'a> Profiler for FlamegraphProfiler<'a> { #[allow(dead_code)] // this infact IS used by benchmarks fn custom_criterion() -> Criterion { Criterion::default() - // .with_profiler(FlamegraphProfiler::new(100)) .warm_up_time(Duration::from_millis(250)) .sample_size(1000) } +#[allow(dead_code)] // this infact IS used by benchmarks +fn custom_criterion_flamegraph() -> Criterion { + custom_criterion().with_profiler(FlamegraphProfiler::new(100)) +} + #[criterion(custom_criterion())] -fn split_function_bench(c: &mut Criterion) { +fn mutli_split_function(c: &mut Criterion) { let data_chars = vec![ "sin(x)cos(x)", "x^2", @@ -88,3 +92,14 @@ fn split_function_bench(c: &mut Criterion) { } group.finish(); } + +// #[criterion(custom_criterion_flamegraph())] +// fn single_split_function(c: &mut Criterion) { +// let data_chars = "(2x+1)(3x+1)".chars().collect::>(); + +// c.bench_function("split_function", |b| { +// b.iter(|| { +// split_function_chars(&data_chars); +// }); +// }); +// }