mirror of
https://github.com/itsjunetime/tdf.git
synced 2026-06-02 08:01:47 -04:00
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:
@@ -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);
|
||||
Reference in New Issue
Block a user