Sergey Konev
a8d83b9bab
Some checks failed
Continuous integration / Tests (push) Blocked by required conditions
Continuous integration / Tests (windows-latest) (push) Waiting to run
Continuous integration / Check clippy, formatting, and documentation (push) Failing after 20s
Continuous integration / Tests (ubuntu-latest) (push) Failing after 22s
Continuous integration / Check fuzzers (push) Failing after 18s
Continuous integration / Check mininum Rust version (push) Failing after 20s
23 lines
650 B
Rust
23 lines
650 B
Rust
use criterion::{criterion_group, criterion_main, Criterion};
|
|
|
|
fn parse_bench(c: &mut Criterion) {
|
|
c.bench_function("parse_full", |b| {
|
|
b.iter(|| {
|
|
let s = std::fs::read_to_string("test-conf/fonts.conf").unwrap();
|
|
fontconfig_parser::parse_config_parts(&s).unwrap();
|
|
});
|
|
});
|
|
}
|
|
|
|
fn merge_bench(c: &mut Criterion) {
|
|
c.bench_function("merge_full", |b| {
|
|
b.iter(|| {
|
|
let mut c = fontconfig_parser::FontConfig::default();
|
|
c.merge_config("test-conf/fonts.conf").unwrap();
|
|
});
|
|
});
|
|
}
|
|
|
|
criterion_group!(benches, parse_bench, merge_bench);
|
|
criterion_main!(benches);
|