mirror of
https://github.com/stefanoamorelli/crabrl.git
synced 2026-04-18 07:10:42 +00:00
- Fix all formatting issues for CI compliance - Consistent code style across all files - Proper struct/enum formatting - Fixed import ordering
24 lines
688 B
Rust
24 lines
688 B
Rust
use crabrl::Parser;
|
|
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
|
|
|
fn parse_small_file(c: &mut Criterion) {
|
|
let parser = Parser::new();
|
|
let content = include_bytes!("../tests/fixtures/small.xml");
|
|
|
|
c.bench_function("parse_small", |b| {
|
|
b.iter(|| parser.parse_bytes(black_box(content)));
|
|
});
|
|
}
|
|
|
|
fn parse_medium_file(c: &mut Criterion) {
|
|
let parser = Parser::new();
|
|
let content = include_bytes!("../tests/fixtures/medium.xml");
|
|
|
|
c.bench_function("parse_medium", |b| {
|
|
b.iter(|| parser.parse_bytes(black_box(content)));
|
|
});
|
|
}
|
|
|
|
criterion_group!(benches, parse_small_file, parse_medium_file);
|
|
criterion_main!(benches);
|