-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Improve benchmarks quality and code duplication (#178)
* fix: correct bench group typo * refactor: Refactor snark benchmark code to remove duplication - Constants have been introduced to replace hard coded values previously used in the verifier circuit and number of samples. - `bench_compressed_snark` function has been restructured, with a new `bench_compressed_snark_internal` function introduced to reduce duplication. - Similar refactoring has also been applied to `bench_compressed_snark_with_computational_commitments`, ensuring uniformity in the code and decreasing duplication. - The benchmark function has been updated to incorporate the use of the new constants as well as the refactored functions. * refactor: Refactor Supernova SNARK benchmarks for code reuse - Refactored benchmarking code in `compressed-snark-supernova.rs` for improved reuse and readability. - Introduced the use of constants for constant values. - Replaced hardcoded assignments with references to declared constants. - Eliminated duplicated benchmarking codes and introduced a shared function for increased efficiency. * refactor: Refactor recursive SNARK benchmarking code - Improved the benchmarking system by introducing a new function `bench_recursive_snark_internal_with_arity`, which offers code reuse. - Replaced a hardcoded number with a constant (`NUM_CONS_VERIFIER_CITCUIT_PRIMARY`) and introduced a new constant (`NUM_SAMPLES`) for setting the benchmark group sample size, - Refactored the functions `bench_one_augmented_circuit_recursive_snark` and `bench_two_augmented_circuit_recursive_snark` to reduce code redundancy and improve maintainability. - Removed unnecessary assertions and error handling process with more concise `.expect` methods. * refactor: Refactor constants in recursive-snark.rs - Introduced named constants (`NUM_CONS_VERIFIER_CIRCUIT_PRIMARY` and `NUM_SAMPLES`) for an enhancement of readability and maintainability. - Improved the benchmarking function through the replacement of hard-coded values with the newly initialized constants. * fix: update num_cons_verifier_circuit_primary * test: Refine supernova recursive circuit tests and benchmarks - Updated the `NUM_CONS_VERIFIER_CIRCUIT_PRIMARY` constant value in both `recursive-snark-supernova` and `compressed-snark-supernova` benchmarks for accurate evaluation. - Enhanced the documentation for `NUM_CONS_VERIFIER_CIRCUIT_PRIMARY` with detailed comments explaining its correlation with `test_supernova_recursive_circuit_pasta` and `num_augmented_circuits`. - Extended the `src/supernova/circuit.rs` module with a new test suite and additional functions to test supernova recursive circuits, * fix: also update constraint values in the loop * refactor: Refine public parameter size hints in compressed supernova bench - Updated public params sizing in `compressed-snark-supernova.rs`.
- Loading branch information
1 parent
cda4a42
commit 75c67a3
Showing
3 changed files
with
127 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters