mirror of
https://github.com/stefanoamorelli/crabrl.git
synced 2026-04-18 07:10:42 +00:00
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
This commit is contained in:
27
benches/parser.rs
Normal file
27
benches/parser.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user