2023-11-17 09:05:16 +01:00
|
|
|
// SPDX-FileCopyrightText: 2023 Christina Sørensen
|
|
|
|
// SPDX-FileContributor: Christina Sørensen
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2023-07-07 06:38:17 +02:00
|
|
|
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
|
|
|
use relative_path::RelativePath;
|
2023-10-06 16:16:56 +02:00
|
|
|
use seidr::git::Config;
|
2023-07-07 06:38:17 +02:00
|
|
|
|
|
|
|
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);
|