Skip to content

Commit

Permalink
add time logging
Browse files Browse the repository at this point in the history
  • Loading branch information
chaosma committed Dec 21, 2024
1 parent 84b4b5f commit 70d54b9
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 14 deletions.
103 changes: 90 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ goldilocks = { git = "https://github.com/scroll-tech/ceno-Goldilocks" }
thiserror = "1"
itertools = { version = "0.13", default-features = false }


[profile.release]
debug = true

Expand All @@ -43,4 +44,4 @@ parallel = [
"ark-crypto-primitives/parallel",
]
rayon = ["dep:rayon"]
ceno = []
ceno = ["ark-std/print-trace"]
7 changes: 7 additions & 0 deletions src/ceno_binding/pcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ where
#[cfg(test)]
mod tests {
use ark_ff::Field;
use ark_std::{end_timer, start_timer};
use rand::Rng;

use super::*;
Expand All @@ -201,14 +202,20 @@ mod tests {
.add_whir_proof(&pp);
let mut merlin = io.to_merlin();

let timer = start_timer!(|| "commit_and_write");
let witness = Whir::<F>::commit_and_write(&pp, &poly, &mut merlin).unwrap();
end_timer!(timer);

let mut rng = rand::thread_rng();
let point: Vec<F> = (0..poly_size).map(|_| F::from(rng.gen::<u64>())).collect();
let eval = poly.evaluate_at_extension(&MultilinearPoint(point.clone()));

let timer = start_timer!(|| "single open");
let proof = Whir::<F>::open(&pp, witness, &point, &eval, &mut merlin).unwrap();
end_timer!(timer);
let timer = start_timer!(|| "single verify");
Whir::<F>::verify(&pp, &point, &eval, &proof, &merlin).unwrap();
end_timer!(timer);
}

#[test]
Expand Down

0 comments on commit 70d54b9

Please sign in to comment.