Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid magic constant in benches #589

Merged
merged 1 commit into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions benches/end2end.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use pasta_curves::pallas;
use std::sync::Arc;
use std::time::Duration;

const PUBLIC_PARAMS_PATH: &str = "/var/tmp/lurk_benches/public_params";
const DEFAULT_REDUCTION_COUNT: usize = 10;

fn go_base<F: LurkField>(store: &mut Store<F>, a: u64, b: u64) -> Ptr<F> {
Expand Down Expand Up @@ -66,7 +67,7 @@ fn end2end_benchmark(c: &mut Criterion) {
let pp = public_parameters::public_params(
reduction_count,
lang_pallas_rc.clone(),
Utf8Path::new("/var/tmp/lurk_benches/public_params"),
Utf8Path::new(PUBLIC_PARAMS_PATH),
)
.unwrap();

Expand Down Expand Up @@ -275,7 +276,7 @@ fn prove_benchmark(c: &mut Criterion) {
let pp = public_parameters::public_params(
reduction_count,
lang_pallas_rc.clone(),
Utf8Path::new("/var/tmp/lurk_benches/public_params"),
Utf8Path::new(PUBLIC_PARAMS_PATH),
)
.unwrap();
let frames = prover
Expand Down Expand Up @@ -319,7 +320,7 @@ fn prove_compressed_benchmark(c: &mut Criterion) {
let pp = public_parameters::public_params(
reduction_count,
lang_pallas_rc.clone(),
Utf8Path::new("/var/tmp/lurk_benches/public_params"),
Utf8Path::new(PUBLIC_PARAMS_PATH),
)
.unwrap();
let frames = prover
Expand Down Expand Up @@ -362,7 +363,7 @@ fn verify_benchmark(c: &mut Criterion) {
let pp = public_parameters::public_params(
reduction_count,
lang_pallas_rc.clone(),
Utf8Path::new("/var/tmp/lurk_benches/public_params"),
Utf8Path::new(PUBLIC_PARAMS_PATH),
)
.unwrap();
let frames = prover
Expand Down Expand Up @@ -411,7 +412,7 @@ fn verify_compressed_benchmark(c: &mut Criterion) {
let pp = public_parameters::public_params(
reduction_count,
lang_pallas_rc.clone(),
Utf8Path::new("/var/tmp/lurk_benches/public_params"),
Utf8Path::new(PUBLIC_PARAMS_PATH),
)
.unwrap();
let frames = prover
Expand Down
5 changes: 3 additions & 2 deletions benches/fibonacci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use lurk::{
store::Store,
};

const PUBLIC_PARAMS_PATH: &str = "/var/tmp/lurk_benches/public_params";
const DEFAULT_REDUCTION_COUNT: usize = 100;
fn fib<F: LurkField>(store: &mut Store<F>, a: u64) -> Ptr<F> {
let program = format!(
Expand Down Expand Up @@ -52,7 +53,7 @@ fn fibo_total<M: measurement::Measurement>(name: &str, iterations: u64, c: &mut
let pp = public_params(
reduction_count,
lang_rc.clone(),
Utf8Path::new("/var/tmp/lurk_benches/public_params"),
Utf8Path::new(PUBLIC_PARAMS_PATH),
)
.unwrap();

Expand Down Expand Up @@ -108,7 +109,7 @@ fn fibo_prove<M: measurement::Measurement>(name: &str, iterations: u64, c: &mut
let pp = public_params(
reduction_count,
lang_rc.clone(),
Utf8Path::new("/var/tmp/lurk_benches/public_params"),
Utf8Path::new(PUBLIC_PARAMS_PATH),
)
.unwrap();

Expand Down
Loading