diff options
Diffstat (limited to 'chomp-bench/benches/arith.rs')
-rw-r--r-- | chomp-bench/benches/arith.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chomp-bench/benches/arith.rs b/chomp-bench/benches/arith.rs index 4ba6ea7..489a847 100644 --- a/chomp-bench/benches/arith.rs +++ b/chomp-bench/benches/arith.rs @@ -24,6 +24,10 @@ fn parse_chewed(input: &str) -> i64 { .into() } +fn parse_handwritten(input: &str) -> i64 { + parse_expr(&mut IterWrapper::new(input.chars())).unwrap() +} + fn bench_parse(c: &mut Criterion) { let plot_config = PlotConfiguration::default().summary_scale(AxisScale::Logarithmic); let mut group = c.benchmark_group("Arith"); @@ -33,6 +37,9 @@ fn bench_parse(c: &mut Criterion) { group.bench_with_input(BenchmarkId::new("Chewed", i), *input, |b, i| { b.iter(|| parse_chewed(i)) }); + group.bench_with_input(BenchmarkId::new("Handwritten", i), *input, |b, i| { + b.iter(|| parse_handwritten(i)) + }); } } |