Files
crabrl/benches/parser.rs
Stefano Amorelli 46ecbd2635 feat: implement CLI for XBRL parsing and validation
- Parse command with optional stats flag
- Validate command with SEC EDGAR profile support
- Benchmark command for performance testing
- Colored output for better UX
2025-08-16 17:25:06 +03:00

27 lines
743 B
Rust

use criterion::{black_box, criterion_group, criterion_main, Criterion};
use crabrl::Parser;
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);