1use criterion::{black_box, criterion_group, Criterion};
2
3use anes::parser::Parser;
4
5pub fn parser(c: &mut Criterion) {
6 const XTERM_MOUSE: &str = "\x1B[<28;20;10;m";
7
8 let mut parser = Parser::default();
9
10 c.bench_function("advance and consume", |b| {
11 let input = XTERM_MOUSE.as_bytes();
12
13 b.iter(|| {
14 parser.advance(black_box(input), black_box(true));
15 while let Some(_) = parser.next() {}
16 })
17 });
18}
19
20criterion_group!(benches, parser);
21