-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into cg/browser-civc
- Loading branch information
Showing
347 changed files
with
6,588 additions
and
3,497 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
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
51 changes: 51 additions & 0 deletions
51
barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/mega_zk_honk.bench.cpp
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include <benchmark/benchmark.h> | ||
|
||
#include "barretenberg/benchmark/ultra_bench/mock_circuits.hpp" | ||
#include "barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp" | ||
|
||
using namespace benchmark; | ||
using namespace bb; | ||
|
||
/** | ||
* @brief Benchmark: Construction of a Ultra Honk proof for a circuit determined by the provided circuit function | ||
*/ | ||
static void construct_proof_megahonk_zk(State& state, | ||
void (*test_circuit_function)(MegaCircuitBuilder&, size_t)) noexcept | ||
{ | ||
size_t num_iterations = 10; // 10x the circuit | ||
bb::mock_circuits::construct_proof_with_specified_num_iterations<MegaZKProver>( | ||
state, test_circuit_function, num_iterations); | ||
} | ||
|
||
/** | ||
* @brief Benchmark: Construction of a Ultra Plonk proof with 2**n gates | ||
*/ | ||
static void construct_proof_megahonk_power_of_2_zk(State& state) noexcept | ||
{ | ||
auto log2_of_gates = static_cast<size_t>(state.range(0)); | ||
bb::mock_circuits::construct_proof_with_specified_num_iterations<MegaZKProver>( | ||
state, &bb::mock_circuits::generate_basic_arithmetic_circuit<MegaCircuitBuilder>, log2_of_gates); | ||
} | ||
|
||
// Define benchmarks | ||
|
||
// This exists due to an issue where get_row was blowing up in time | ||
BENCHMARK_CAPTURE(construct_proof_megahonk_zk, sha256, &stdlib::generate_sha256_test_circuit<MegaCircuitBuilder>) | ||
->Unit(kMillisecond); | ||
BENCHMARK_CAPTURE(construct_proof_megahonk_zk, keccak, &stdlib::generate_keccak_test_circuit<MegaCircuitBuilder>) | ||
->Unit(kMillisecond); | ||
BENCHMARK_CAPTURE(construct_proof_megahonk_zk, | ||
ecdsa_verification, | ||
&stdlib::generate_ecdsa_verification_test_circuit<MegaCircuitBuilder>) | ||
->Unit(kMillisecond); | ||
BENCHMARK_CAPTURE(construct_proof_megahonk_zk, | ||
merkle_membership, | ||
&stdlib::generate_merkle_membership_test_circuit<MegaCircuitBuilder>) | ||
->Unit(kMillisecond); | ||
|
||
BENCHMARK(construct_proof_megahonk_power_of_2_zk) | ||
// 2**15 gates to 2**20 gates | ||
->DenseRange(15, 20) | ||
->Unit(kMillisecond); | ||
|
||
BENCHMARK_MAIN(); |
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
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
Oops, something went wrong.