-
Notifications
You must be signed in to change notification settings - Fork 40
Merge two similar benchmarks in BaseFold into one #554
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
mpcs/src/lib.rs
Outdated
| // unfortunately integration benchmarks do not compile the #[cfg(test)] | ||
| // code. So remove the gate for the entire module, only gate the test | ||
| // functions. | ||
| // TODO(Matthias): use cfg(or(test, bench)) or something like that. |
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.
We might want to actually do this. :) Let me see what I can do for you. (Or otherwise, remove my TODO-comment from the PR.)
| } | ||
| pub fn gen_rand_poly_base<E: ExtensionField>(num_vars: usize) -> DenseMultilinearExtension<E> { | ||
| DenseMultilinearExtension::random(num_vars, &mut OsRng) | ||
| } |
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.
in lib code (instead of testing code), we usually don't hard code RNG directly. (besides, OsRng is slow actually, most of the time we need some kind of lightweighted rng like CHACHA RNG, that would be enough.
So i suggest give user of this function the freedom to choose rng , and it is ok to use osrng in testing codes)
| // functions. | ||
| // This is not the best way: the test utility functions should not be | ||
| // compiled in the release build. Need a better solution. | ||
| #[doc(hidden)] |
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.
in zkevm-circuits, we have a "test" feature flag. and we write "#[cfg(any(feature = "test", test))]" a lot of places.
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.
That means we run benchmarks using cargo bench --features "test"?
Extracting small PR from #294.
The two benchmarks
benches_commit_verify_rsandbenches_commit_verify_basecodeare similar, differing only in the choice of parameter. Merge them into one benchmark file.Also simplify the codes using the test utility functions introduced in #552
Waiting for #552 to merge.