1#include <benchmark/benchmark.h>
9using namespace benchmark;
18Builder generate_trace(
size_t target_num_gates)
22 using Fr =
typename G1::Fr;
26 typename G1::element
a = generators[0];
27 typename G1::element
b = generators[1];
33 size_t num_iterations = target_num_gates / 163;
34 for (
size_t _ = 0; _ < num_iterations; _++) {
35 op_queue->add_accumulate(
a);
36 op_queue->mul_accumulate(
a, x);
37 op_queue->mul_accumulate(
b, x);
38 op_queue->mul_accumulate(
b, y);
39 op_queue->add_accumulate(
a);
40 op_queue->mul_accumulate(
b, x);
41 op_queue->eq_and_reset();
52void eccvm_generate_prover(State& state)
noexcept
55 size_t target_num_gates = 1 <<
static_cast<size_t>(state.range(0));
56 for (
auto _ : state) {
63template <
typename Prover>
void construct_proof(State& state)
noexcept
65 size_t target_num_gates = 1 <<
static_cast<size_t>(state.range(0));
66 for (
auto _ : state) {
69 Prover prover(
builder, prover_transcript);
70 auto proof = prover.construct_proof();
71 benchmark::DoNotOptimize(proof);
72 benchmark::DoNotOptimize(prover.ipa_proof);
76template <
typename Prover>
void execute_sumcheck(State& state)
noexcept
78 size_t target_num_gates = 1 <<
static_cast<size_t>(state.range(0));
79 for (
auto _ : state) {
83 Prover prover(
builder, prover_transcript);
84 prover.execute_preamble_round();
85 prover.execute_wire_commitments_round();
86 prover.execute_log_derivative_commitments_round();
87 prover.execute_grand_product_computation_round();
90 prover.execute_relation_check_rounds();
91 benchmark::DoNotOptimize(prover.sumcheck_output);
95void eccvm_full_prove(State& state)
noexcept
97 construct_proof<ECCVMProver>(state);
100void eccvm_full_sumcheck(State& state)
noexcept
102 execute_sumcheck<ECCVMProver>(state);
105BENCHMARK(eccvm_generate_prover)->Unit(kMillisecond)->DenseRange(12, CONST_ECCVM_LOG_N);
106BENCHMARK(eccvm_full_prove)->Unit(kMillisecond)->DenseRange(12, CONST_ECCVM_LOG_N);
107BENCHMARK(eccvm_full_sumcheck)->Unit(kMillisecond)->DenseRange(12, CONST_ECCVM_LOG_N);
113 benchmark::Initialize(&argc, argv);
114 benchmark::RunSpecifiedBenchmarks();
115 benchmark::Shutdown();
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
BaseTranscript< Codec, HashFunction > Transcript
std::filesystem::path bb_crs_path()
void init_file_crs_factory(const std::filesystem::path &path)
Entry point for Barretenberg command-line interface.
constexpr std::span< const typename Group::affine_element > get_precomputed_generators()
BENCHMARK(bench_commit_structured_random_poly< curve::BN254 >) -> Unit(benchmark::kMillisecond)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
static field random_element(numeric::RNG *engine=nullptr) noexcept