From eed72b94782b63b854d66158db1e229a9f12b004 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Tue, 27 Feb 2024 17:09:41 +0000 Subject: [PATCH] use size hint --- .../src/barretenberg/benchmark/ivc_bench/ivc.bench.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 e9ba9ed185e..2beea13e9f2 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/ivc_bench/ivc.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ivc_bench/ivc.bench.cpp @@ -43,13 +43,14 @@ class IvcBench : public benchmark::Fixture { */ static void perform_ivc_accumulation_rounds(State& state, ClientIVC& ivc) { + const size_t size_hint = 1 << 17; // Size hint for reserving wires/selector vector memory in builders // Initialize IVC with function circuit - Builder function_circuit{ ivc.goblin.op_queue }; + Builder function_circuit{ size_hint, ivc.goblin.op_queue }; GoblinMockCircuits::construct_mock_function_circuit(function_circuit); ivc.initialize(function_circuit); // Accumulate kernel circuit (first kernel mocked as simple circuit since no folding proofs yet) - Builder kernel_circuit{ ivc.goblin.op_queue }; + Builder kernel_circuit{ size_hint, ivc.goblin.op_queue }; GoblinMockCircuits::construct_mock_function_circuit(kernel_circuit); auto kernel_fold_proof = ivc.accumulate(kernel_circuit); @@ -58,12 +59,12 @@ class IvcBench : public benchmark::Fixture { for (size_t circuit_idx = 0; circuit_idx < NUM_CIRCUITS; ++circuit_idx) { // Accumulate function circuit - Builder function_circuit{ ivc.goblin.op_queue }; + Builder function_circuit{ size_hint, ivc.goblin.op_queue }; GoblinMockCircuits::construct_mock_function_circuit(function_circuit); auto function_fold_proof = ivc.accumulate(function_circuit); // Accumulate kernel circuit - Builder kernel_circuit{ ivc.goblin.op_queue }; + Builder kernel_circuit{ size_hint, ivc.goblin.op_queue }; GoblinMockCircuits::construct_mock_folding_kernel(kernel_circuit, function_fold_proof, kernel_fold_proof); auto kernel_fold_proof = ivc.accumulate(kernel_circuit); }