seidr/benches/basic_bench.rs
Christina Sørensen 03b5a617c6
build(nix): do crane EZA style
This is essentailly taken from the work of 9glenda
https://github.com/eza-community/eza/pull/462

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2023-10-06 16:16:56 +02:00

16 lines
480 B
Rust

use criterion::{black_box, criterion_group, criterion_main, Criterion};
use relative_path::RelativePath;
use seidr::git::Config;
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);