Skip to content

Conversation

@yczhangsjtu
Copy link
Collaborator

Extracting small PR from #294.

The two benchmarks benches_commit_verify_rs and benches_commit_verify_basecode are 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.

@yczhangsjtu yczhangsjtu changed the title Feat/basefold refactor extract 1 Merge two similar benchmarks in BaseFold into one. Nov 5, 2024
@matthiasgoergens matthiasgoergens changed the title Merge two similar benchmarks in BaseFold into one. Merge two similar benchmarks in BaseFold into one Nov 11, 2024
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.
Copy link
Contributor

@matthiasgoergens matthiasgoergens Nov 11, 2024

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.)

Base automatically changed from feat/basefold-refactor-extract-0 to master November 28, 2024 05:44
@yczhangsjtu yczhangsjtu marked this pull request as ready for review November 28, 2024 05:46
}
pub fn gen_rand_poly_base<E: ExtensionField>(num_vars: usize) -> DenseMultilinearExtension<E> {
DenseMultilinearExtension::random(num_vars, &mut OsRng)
}
Copy link
Collaborator

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)]
Copy link
Collaborator

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.

Copy link
Collaborator Author

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"?

@yczhangsjtu yczhangsjtu merged commit 3e5262c into master Nov 28, 2024
@yczhangsjtu yczhangsjtu deleted the feat/basefold-refactor-extract-1 branch November 28, 2024 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants