1#include <benchmark/benchmark.h>
7using namespace benchmark;
18 for (
size_t i = 0; i < count; ++i) {
19 op_queue->random_op_ultra_only();
25 auto point_a = g1::affine_element::random_element();
26 auto point_b = g1::affine_element::random_element();
29 for (
size_t i = 0; i < count; ++i) {
30 op_queue->add_accumulate(point_a);
31 op_queue->mul_accumulate(point_b, scalar);
33 op_queue->eq_and_reset();
39 op_queue->construct_zk_columns();
41 constexpr size_t usable_rows =
43 const size_t target_rows = usable_rows * capacity_percent / 100;
46 add_mixed_ops(op_queue, mixed_op_count);
48 op_queue->merge_fixed_append(op_queue->get_append_offset());
53template <
typename Prover,
typename ProvingKey>
void construct_proof(State& state)
55 const size_t capacity_percent =
static_cast<size_t>(state.range(0));
56 for (
auto _ : state) {
57 auto circuit = generate_translator_circuit(capacity_percent);
60 Prover prover{ proving_key, transcript };
61 benchmark::DoNotOptimize(prover.construct_proof());
63 state.counters[
"capacity_percent"] =
static_cast<double>(capacity_percent);
66template <
typename Prover,
typename ProvingKey>
void execute_sumcheck(State& state)
68 const size_t capacity_percent =
static_cast<size_t>(state.range(0));
69 for (
auto _ : state) {
71 auto circuit = generate_translator_circuit(capacity_percent);
74 Prover prover{ proving_key, transcript };
75 prover.execute_preamble_round();
76 prover.execute_wire_and_sorted_constraints_commitments_round();
77 prover.execute_grand_product_computation_round();
80 prover.execute_relation_check_rounds();
81 benchmark::DoNotOptimize(prover.sumcheck_output);
83 state.counters[
"capacity_percent"] =
static_cast<double>(capacity_percent);
86void translator_full_prove(State& state)
88 construct_proof<TranslatorProver, TranslatorProvingKey>(state);
91void translator_full_sumcheck(State& state)
93 execute_sumcheck<TranslatorProver, TranslatorProvingKey>(state);
96BENCHMARK(translator_full_prove)->Unit(kMillisecond)->Arg(25)->Arg(50)->Arg(75);
97BENCHMARK(translator_full_sumcheck)->Unit(kMillisecond)->Arg(25)->Arg(50)->Arg(75);
104 benchmark::Initialize(&argc, argv);
105 benchmark::RunSpecifiedBenchmarks();
106 benchmark::Shutdown();
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
TranslatorCircuitBuilder creates a circuit that evaluates the correctness of the evaluation of EccOpQ...
static constexpr size_t NUM_RANDOM_OPS_END
BaseTranscript< Codec, HashFunction > Transcript
TranslatorCircuitBuilder CircuitBuilder
static constexpr size_t RESULT_ROW
static constexpr size_t dyadic_mini_circuit_size_without_masking
std::filesystem::path bb_crs_path()
void init_file_crs_factory(const std::filesystem::path &path)
Entry point for Barretenberg command-line interface.
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