mirror of
https://github.com/vacp2p/zerokit.git
synced 2025-01-10 22:36:17 +00:00
d8f813bc2e
* chore(rln): optimize into Lazy OnceCells * fix * fix: dont change duration * fix: increase duration? * chore: add backtrace * fix: remove plotter to avoid f64 range failure * fix: remove ci alteration * fix: use arc over witness calc * fix: remove more lifetimes * fix: benchmark correct fn call, not the getter * fix: bench config
23 lines
735 B
Rust
23 lines
735 B
Rust
use criterion::{criterion_group, criterion_main, Criterion};
|
|
use rln::circuit::{vk_from_ark_serialized, VK_BYTES};
|
|
|
|
// Here we benchmark how long the deserialization of the
|
|
// verifying_key takes, only testing the json => verifying_key conversion,
|
|
// and skipping conversion from bytes => string => serde_json::Value
|
|
pub fn vk_deserialize_benchmark(c: &mut Criterion) {
|
|
let vk = VK_BYTES;
|
|
|
|
c.bench_function("vk::vk_from_ark_serialized", |b| {
|
|
b.iter(|| {
|
|
let _ = vk_from_ark_serialized(vk);
|
|
})
|
|
});
|
|
}
|
|
|
|
criterion_group! {
|
|
name = benches;
|
|
config = Criterion::default().measurement_time(std::time::Duration::from_secs(10));
|
|
targets = vk_deserialize_benchmark
|
|
}
|
|
criterion_main!(benches);
|