-
Notifications
You must be signed in to change notification settings - Fork 121
Saffron/benches: add bench for read proof #3204
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
Conversation
81ebe48
to
66b321d
Compare
66b321d
to
40c1709
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool stuff 👍
}; | ||
|
||
// Set up static resources to avoid re-computation during benchmarks | ||
static SRS: Lazy<SRS<Vesta>> = Lazy::new(|| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe using pub fn get_srs_test<G>() -> SRS<G>
from kimchi/src/precomputed_srs.rs
would be a more canonical way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems ok, but only because we have the same size. I was first thinking about making the change, but wondering now if it is the best as Saffron and Kimchi are too different protocols. We might want to differentiate them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened #3208 but I am not totally convinced we should do it. Feel free to accept if you have a strong opinion.
} | ||
|
||
fn bench_read_proof_verify(c: &mut Criterion) { | ||
let (data, query, answer, data_comm) = generate_test_data(SRS_SIZE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A word of caution: the default kimchi prover/verifier bench is quite inaccurate, so you might need to set up bench parameters manually if you want to achieve meaningfully low noise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand why you are mentioning the kimchi prover/verifier here. Can you explain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect it will largely generalise, only mentioned it as a particular example. I guess on average it's hard to measure verification precisely (because of multi-threading? I'm not sure why actually).
@@ -0,0 +1,117 @@ | |||
//! Run this bench using `cargo criterion -p saffron --bench read_proof_bench` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ cargo criterion -p saffron --bench read_proof_bench
error: no such command: `criterion`
View all installed commands with `cargo --list`
Find a package to install `criterion` with `cargo search cargo-criterion`
Is there something I am missing to run this command ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cargo install cargo-criterion
This will be used to compare with the upcoming optimization of read proofs.