8b20c2a490
Setup only for loading config file for now, probably not a lot of code here that is super intensive, but having the structure set up to bench is pretty nice when it's needed suddenly. Two steps ahead as always, still haven't capitalized on the architecture rewrite, yet here I am adding this. Signed-off-by: Christina Sørensen <christina@cafkafk.com>
16 lines
477 B
Rust
16 lines
477 B
Rust
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
|
use gg::git::Config;
|
|
use relative_path::RelativePath;
|
|
|
|
pub fn criterion_benchmark(c: &mut Criterion) {
|
|
c.bench_function("config loading time", |b| {
|
|
b.iter(|| {
|
|
Config::new(black_box(
|
|
&RelativePath::new(black_box("./src/test/config.yaml")).to_string(),
|
|
))
|
|
});
|
|
});
|
|
}
|
|
|
|
criterion_group!(benches, criterion_benchmark);
|
|
criterion_main!(benches);
|