diff --git a/barretenberg/cpp/scripts/analyze_client_ivc_bench.py b/barretenberg/cpp/scripts/analyze_client_ivc_bench.py index 485725375bc..600854679c5 100644 --- a/barretenberg/cpp/scripts/analyze_client_ivc_bench.py +++ b/barretenberg/cpp/scripts/analyze_client_ivc_bench.py @@ -66,7 +66,7 @@ print('\nBreakdown of ProtogalaxyProver::prove:') protogalaxy_round_labels = [ - "ProtogalaxyProver_::preparation_round(t)", + "ProtogalaxyProver_::run_oink_prover_on_each_incomplete_key(t)", "ProtogalaxyProver_::perturbator_round(t)", "ProtogalaxyProver_::combiner_quotient_round(t)", "ProtogalaxyProver_::update_target_sum_and_fold(t)" diff --git a/barretenberg/cpp/scripts/analyze_protogalaxy_bench.py b/barretenberg/cpp/scripts/analyze_protogalaxy_bench.py index b5686fc351a..bb1906678eb 100755 --- a/barretenberg/cpp/scripts/analyze_protogalaxy_bench.py +++ b/barretenberg/cpp/scripts/analyze_protogalaxy_bench.py @@ -47,7 +47,7 @@ print('\nBreakdown of ProtogalaxyProver::prove:') protogalaxy_round_labels = [ - "ProtogalaxyProver_::preparation_round(t)", + "ProtogalaxyProver_::run_oink_prover_on_each_incomplete_key(t)", "ProtogalaxyProver_::perturbator_round(t)", "ProtogalaxyProver_::combiner_quotient_round(t)", "ProtogalaxyProver_::update_target_sum_and_fold(t)" diff --git a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/CMakeLists.txt index 16230d801c8..319463b5bc5 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/CMakeLists.txt @@ -1,4 +1,4 @@ barretenberg_module( protogalaxy_bench - stdlib_protogalaxy_verifier + protogalaxy ) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp index aad7be68295..105bbb564ce 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp @@ -2,6 +2,7 @@ #include "barretenberg/common/op_count_google_bench.hpp" #include "barretenberg/protogalaxy/protogalaxy_prover.hpp" +#include "barretenberg/protogalaxy/protogalaxy_prover_internal.hpp" #include "barretenberg/stdlib_circuit_builders/mock_circuits.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp" #include "barretenberg/ultra_honk/decider_keys.hpp" @@ -11,9 +12,42 @@ using namespace benchmark; namespace bb { +using Flavor = MegaFlavor; +using FF = typename Flavor::FF; + +void vector_of_evaluations(State& state) noexcept +{ + using RelationEvaluations = typename Flavor::TupleOfArraysOfValues; + + for (auto _ : state) { + std::vector evals(1 << state.range(0)); + DoNotOptimize(evals); + } +} + +void compute_row_evaluations(State& state) noexcept +{ + using Fun = ProtogalaxyProverInternal>; + using Polys = Flavor::ProverPolynomials; + using Alphas = Flavor::RelationSeparator; + using Params = RelationParameters; + + const size_t dyadic_size = 1 << state.range(0); + Polys polys(dyadic_size); + Alphas alphas; + auto params = Params::get_random(); + + for (auto _ : state) { + auto result = Fun::compute_row_evaluations(polys, alphas, params); + DoNotOptimize(result); + } +} + // Fold one proving key into an accumulator. -template void fold_k(State& state) noexcept +void fold_k(State& state) noexcept { + static constexpr size_t k{ 1 }; + using DeciderProvingKey = DeciderProvingKey_; using ProtogalaxyProver = ProtogalaxyProver_>; using Builder = typename Flavor::CircuitBuilder; @@ -41,8 +75,10 @@ template void fold_k(State& state) noexcept } } +BENCHMARK(vector_of_evaluations)->DenseRange(15, 21)->Unit(kMillisecond); +BENCHMARK(compute_row_evaluations)->DenseRange(15, 21)->Unit(kMillisecond); // We stick to just k=1 for compile-time reasons. -BENCHMARK(fold_k)->/* vary the circuit size */ DenseRange(14, 20)->Unit(kMillisecond); +BENCHMARK(fold_k)->/* vary the circuit size */ DenseRange(14, 20)->Unit(kMillisecond); } // namespace bb