From 799203de3509907b7f2e61cbbb113bf205e70a66 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 23 Oct 2023 17:40:37 +0000 Subject: [PATCH] Lighter weight stuffs --- barretenberg/cpp/CMakePresets.json | 6 +++--- .../benchmark/honk_bench/ultra_honk_passes.bench.cpp | 10 ++++------ .../cpp/src/barretenberg/common/compiler_hints.hpp | 12 ++++-------- .../barretenberg/honk/proof_system/ultra_prover.hpp | 12 ++++++------ 4 files changed, 17 insertions(+), 23 deletions(-) diff --git a/barretenberg/cpp/CMakePresets.json b/barretenberg/cpp/CMakePresets.json index 3a460d20af3..9b3dbbe6d80 100644 --- a/barretenberg/cpp/CMakePresets.json +++ b/barretenberg/cpp/CMakePresets.json @@ -202,9 +202,9 @@ "generator": "Unix Makefiles", "inherits": "clang16", "environment": { - "CFLAGS": "-fxray-instrument -fxray-instruction-threshold=100", - "CXXFLAGS": "-fxray-instrument -fxray-instruction-threshold=100", - "LDFLAGS": "-fxray-instrument -fxray-instruction-threshold=100" + "CFLAGS": "-fxray-instrument", + "CXXFLAGS": "-fxray-instrument -fxray-instruction-threshold=500", + "LDFLAGS": "-fxray-instrument -fxray-instruction-threshold=500" }, "binaryDir": "build-xray" }, diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_honk_passes.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_honk_passes.bench.cpp index ba28fd2810c..c150fdb79b3 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_honk_passes.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_honk_passes.bench.cpp @@ -10,9 +10,7 @@ using namespace proof_system; enum { PREAMBLE, WIRE_COMMITMENTS, SORTED_LIST_ACCUMULATOR, GRAND_PRODUCT_COMPUTATION, RELATION_CHECK, ZEROMORPH }; -BBERG_INSTRUMENT BBERG_NOINLINE static void test_pass_inner(State& state, - honk::UltraProver& prover, - size_t index) noexcept +BBERG_PROFILE static void test_pass_inner(State& state, honk::UltraProver& prover, size_t index) noexcept { auto time_if_index = [&](size_t target_index, auto&& func) -> void { @@ -35,13 +33,13 @@ BBERG_INSTRUMENT BBERG_NOINLINE static void test_pass_inner(State& state, state.ResumeTiming(); } } -BBERG_INSTRUMENT BBERG_NOINLINE static void test_pass(State& state, size_t index) noexcept +BBERG_PROFILE static void test_pass(State& state, size_t index) noexcept { barretenberg::srs::init_crs_factory("../srs_db/ignition"); honk::UltraComposer composer; - honk::UltraProver prover = - bench_utils::get_prover(composer, &bench_utils::generate_keccak_test_circuit, 1); + honk::UltraProver prover = bench_utils::get_prover( + composer, &bench_utils::generate_ecdsa_verification_test_circuit, 10); test_pass_inner(state, prover, index); } #define PASS_BENCHMARK(pass) \ diff --git a/barretenberg/cpp/src/barretenberg/common/compiler_hints.hpp b/barretenberg/cpp/src/barretenberg/common/compiler_hints.hpp index c3bdf3cf6b9..400ddf91d60 100644 --- a/barretenberg/cpp/src/barretenberg/common/compiler_hints.hpp +++ b/barretenberg/cpp/src/barretenberg/common/compiler_hints.hpp @@ -6,13 +6,9 @@ #define BBERG_INLINE __attribute__((always_inline)) inline #endif -// TODO(AD): Other compilers -#if defined(__clang__) -#define BBERG_INSTRUMENT [[clang::xray_always_instrument]] -#define BBERG_NO_INSTRUMENT [[clang::xray_never_instrument]] -#define BBERG_NOINLINE [[clang::noinline]] +// TODO(AD): Other instrumentation? +#ifdef XRAY +#define BBERG_PROFILE [[clang::xray_always_instrument]] [[clang::noinline]] #else -#define BBERG_INSTRUMENT -#define BBERG_NO_INSTRUMENT -#define BBERG_NOINLINE +#define BBERG_PROFILE #endif \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/honk/proof_system/ultra_prover.hpp b/barretenberg/cpp/src/barretenberg/honk/proof_system/ultra_prover.hpp index 4be07e693a8..a592fde4755 100644 --- a/barretenberg/cpp/src/barretenberg/honk/proof_system/ultra_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/honk/proof_system/ultra_prover.hpp @@ -23,12 +23,12 @@ template class UltraProver_ { public: explicit UltraProver_(std::shared_ptr); - void execute_preamble_round(); - void execute_wire_commitments_round(); - void execute_sorted_list_accumulator_round(); - void execute_grand_product_computation_round(); - void execute_relation_check_rounds(); - void execute_zeromorph_rounds(); + BBERG_PROFILE void execute_preamble_round(); + BBERG_PROFILE void execute_wire_commitments_round(); + BBERG_PROFILE void execute_sorted_list_accumulator_round(); + BBERG_PROFILE void execute_grand_product_computation_round(); + BBERG_PROFILE void execute_relation_check_rounds(); + BBERG_PROFILE void execute_zeromorph_rounds(); plonk::proof& export_proof(); plonk::proof& construct_proof();