//! This benchmark tests how fast the lexer can scan through huge source code. use alkale::SourceCodeScanner; use criterion::{criterion_group, Criterion}; fn scan(source: &str) { let ctx = SourceCodeScanner::new(source); while ctx.has_next() { let _ = ctx.peek(); let _ = ctx.next(); } } fn bench(criterion: &mut Criterion) { let source = "Tยต๐Ÿ“8โˆž".repeat(10000); // 50k chars, 100k bytes criterion.bench_function("scan", |x| x.iter(|| scan(&source))); } criterion_group!(benches, bench);