Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
mega_zk_honk.bench.cpp
Go to the documentation of this file.
1#include <benchmark/benchmark.h>
2
5
6using namespace benchmark;
7using namespace bb;
8
12static void construct_proof_megahonk_zk(State& state,
13 void (*test_circuit_function)(MegaCircuitBuilder&, size_t)) noexcept
14{
15 size_t num_iterations = 10; // 10x the circuit
16 bb::mock_circuits::construct_proof_with_specified_num_iterations<MegaZKProver>(
17 state, test_circuit_function, num_iterations);
18}
19
23static void construct_proof_megahonk_power_of_2_zk(State& state) noexcept
24{
25 auto log2_of_gates = static_cast<size_t>(state.range(0));
26 bb::mock_circuits::construct_proof_with_specified_num_iterations<MegaZKProver>(
27 state, &bb::mock_circuits::generate_basic_arithmetic_circuit<MegaCircuitBuilder>, log2_of_gates);
28}
29
30// Define benchmarks
31
32// This exists due to an issue where get_row was blowing up in time
33BENCHMARK_CAPTURE(construct_proof_megahonk_zk, sha256, &generate_sha256_test_circuit<MegaCircuitBuilder>)
34 ->Unit(kMillisecond);
35BENCHMARK_CAPTURE(construct_proof_megahonk_zk,
36 ecdsa_verification,
37 &stdlib::generate_ecdsa_verification_test_circuit<MegaCircuitBuilder>)
38 ->Unit(kMillisecond);
39
40BENCHMARK(construct_proof_megahonk_power_of_2_zk)
41 // 2**15 gates to 2**20 gates
42 ->DenseRange(15, 20)
43 ->Unit(kMillisecond);
44
BENCHMARK_MAIN()
BENCHMARK_CAPTURE(construct_proof_megahonk_zk, ecdsa_verification, &stdlib::generate_ecdsa_verification_test_circuit< MegaCircuitBuilder >) -> Unit(kMillisecond)
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
BENCHMARK(bench_commit_structured_random_poly< curve::BN254 >) -> Unit(benchmark::kMillisecond)