Add initial support for doing benchmarking and some starting info on how to build the benchmark stuff with poppler debug info

This commit is contained in:
itsjunetime
2024-06-03 22:16:05 -06:00
parent 017596a8b0
commit 7e2d0d3bea
13 changed files with 531 additions and 49 deletions
+30
View File
@@ -0,0 +1,30 @@
mod utils;
use utils::render_doc;
use criterion::{criterion_group, criterion_main, Criterion};
fn render_dict(c: &mut Criterion) {
c.bench_function(
"example dictionary",
|b| b.iter(||
tokio::runtime::Runtime::new()
.unwrap()
.block_on(render_doc("./benches/example_dictionary.pdf"))
)
);
}
fn render_example(c: &mut Criterion) {
c.bench_function(
"adobe-provided sample",
|b| b.iter(||
tokio::runtime::Runtime::new()
.unwrap()
.block_on(render_doc("./benches/adobe_example.pdf"))
)
);
}
criterion_group!(benches, render_dict, render_example);
criterion_main!(benches);