diff --git a/barretenberg/cpp/scripts/collect_profile_information.sh b/barretenberg/cpp/scripts/collect_profile_information.sh index ebc0249392e..1323e157b02 100755 --- a/barretenberg/cpp/scripts/collect_profile_information.sh +++ b/barretenberg/cpp/scripts/collect_profile_information.sh @@ -15,7 +15,7 @@ cd $(dirname $0)/.. # Configure and build with xray preset. cmake --preset $PRESET -cmake --build --preset $PRESET +cmake --build --preset $PRESET --target $EXECUTABLE cd build-$PRESET diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ivc_bench/ivc.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ivc_bench/ivc.bench.cpp index 0707203510c..fb95a7fd728 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/ivc_bench/ivc.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ivc_bench/ivc.bench.cpp @@ -115,6 +115,7 @@ BENCHMARK_DEFINE_F(IvcBench, Accumulate)(benchmark::State& state) ivc.precompute_folding_verification_keys(); // Perform a specified number of iterations of function/kernel accumulation for (auto _ : state) { + BB_REPORT_OP_COUNT_IN_BENCH(state); perform_ivc_accumulation_rounds(state, ivc); } } @@ -126,13 +127,12 @@ BENCHMARK_DEFINE_F(IvcBench, Accumulate)(benchmark::State& state) BENCHMARK_DEFINE_F(IvcBench, Decide)(benchmark::State& state) { ClientIVC ivc; - ivc.precompute_folding_verification_keys(); - BB_REPORT_OP_COUNT_IN_BENCH(state); // Perform a specified number of iterations of function/kernel accumulation perform_ivc_accumulation_rounds(state, ivc); // Construct eccvm proof, measure only translator proof construction for (auto _ : state) { + BB_REPORT_OP_COUNT_IN_BENCH(state); ivc.decider_prove(); } } @@ -144,13 +144,12 @@ BENCHMARK_DEFINE_F(IvcBench, Decide)(benchmark::State& state) BENCHMARK_DEFINE_F(IvcBench, ECCVM)(benchmark::State& state) { ClientIVC ivc; - ivc.precompute_folding_verification_keys(); - BB_REPORT_OP_COUNT_IN_BENCH(state); // Perform a specified number of iterations of function/kernel accumulation perform_ivc_accumulation_rounds(state, ivc); // Construct and measure eccvm only for (auto _ : state) { + BB_REPORT_OP_COUNT_IN_BENCH(state); ivc.goblin.prove_eccvm(); } } diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp index 9dd76691320..873920aad42 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp @@ -39,10 +39,10 @@ class ClientIVCTests : public ::testing::Test { 2) * */ - static Builder create_mock_circuit(ClientIVC& ivc, size_t num_gates = 1 << 15) + static Builder create_mock_circuit(ClientIVC& ivc, size_t log2_num_gates = 15) { Builder circuit{ ivc.goblin.op_queue }; - GoblinMockCircuits::construct_arithmetic_circuit(circuit, num_gates); + GoblinMockCircuits::construct_arithmetic_circuit(circuit, log2_num_gates); GoblinMockCircuits::construct_goblin_ecc_op_circuit(circuit); return circuit; } diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.hpp index 73369a2965d..c842e53177e 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.hpp @@ -7,6 +7,7 @@ * simplify the codebase. */ +#include "barretenberg/common/op_count.hpp" #include "barretenberg/ecc/scalar_multiplication/scalar_multiplication.hpp" #include "barretenberg/numeric/bitop/pow.hpp" #include "barretenberg/polynomials/polynomial.hpp" @@ -64,6 +65,7 @@ template class CommitmentKey { */ Commitment commit(std::span polynomial) { + BB_OP_COUNT_TIME(); const size_t degree = polynomial.size(); ASSERT(degree <= srs->get_monomial_size()); return bb::scalar_multiplication::pippenger_unsafe( diff --git a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp index 15ef2ca19ad..4a12e1a2747 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp +++ b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp @@ -1,6 +1,7 @@ #pragma once #include "barretenberg/commitment_schemes/commitment_key.hpp" +#include "barretenberg/common/op_count.hpp" #include "barretenberg/crypto/ecdsa/ecdsa.hpp" #include "barretenberg/crypto/merkle_tree/membership.hpp" #include "barretenberg/crypto/merkle_tree/memory_store.hpp" @@ -108,6 +109,7 @@ class GoblinMockCircuits { */ static void construct_mock_function_circuit(GoblinUltraBuilder& builder, bool large = false) { + BB_OP_COUNT_TIME(); // Determine number of times to execute the below operations that constitute the mock circuit logic. Note // that the circuit size does not scale linearly with number of iterations due to e.g. amortization of // lookup costs @@ -233,6 +235,7 @@ class GoblinMockCircuits { const VerifierFoldData& kernel, std::shared_ptr& prev_kernel_accum) { + BB_OP_COUNT_TIME(); using GURecursiveFlavor = GoblinUltraRecursiveFlavor_; using RecursiveVerifierInstances = bb::stdlib::recursion::honk::RecursiveVerifierInstances_; diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp index e071bbbebab..07c27aba2e4 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp @@ -1,4 +1,5 @@ #pragma once +#include "barretenberg/common/op_count.hpp" #include "barretenberg/common/thread.hpp" #include "barretenberg/ecc/curves/bn254/fr.hpp" #include "barretenberg/flavor/flavor.hpp" @@ -240,6 +241,7 @@ template class ProtoGalaxyProver_ { static Polynomial compute_perturbator(const std::shared_ptr accumulator, const std::vector& deltas) { + BB_OP_COUNT_TIME(); auto full_honk_evaluations = compute_full_honk_evaluations( accumulator->prover_polynomials, accumulator->alphas, accumulator->relation_parameters); const auto betas = accumulator->gate_challenges; @@ -291,6 +293,7 @@ template class ProtoGalaxyProver_ { */ ExtendedUnivariateWithRandomization compute_combiner(const ProverInstances& instances, PowPolynomial& pow_betas) { + BB_OP_COUNT_TIME(); size_t common_instance_size = instances[0]->instance_size; pow_betas.compute_values(); // Determine number of threads for multithreading.