2024-05-06 11:09:22 +00:00
|
|
|
use criterion::{criterion_group, criterion_main, Criterion};
|
|
|
|
|
|
|
|
// Depending on the key type (enabled by the `--features arkzkey` flag)
|
|
|
|
// the upload speed from the `rln_final.zkey` or `rln_final.arkzkey` file is calculated
|
|
|
|
pub fn key_load_benchmark(c: &mut Criterion) {
|
|
|
|
c.bench_function("zkey::upload_from_folder", |b| {
|
|
|
|
b.iter(|| {
|
2024-05-10 11:13:00 +00:00
|
|
|
let _ = rln::circuit::zkey_from_folder();
|
2024-05-06 11:09:22 +00:00
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-06-07 09:46:44 +00:00
|
|
|
criterion_group! {
|
|
|
|
name = benches;
|
|
|
|
config = Criterion::default().measurement_time(std::time::Duration::from_secs(250));
|
|
|
|
targets = key_load_benchmark
|
|
|
|
}
|
2024-05-06 11:09:22 +00:00
|
|
|
criterion_main!(benches);
|