From cdacc17433a977a9227c506f1022d6fb9e4e1509 Mon Sep 17 00:00:00 2001 From: codygunton Date: Tue, 9 Jan 2024 20:37:15 +0000 Subject: [PATCH 1/3] Rename honk bench folder more accurately --- barretenberg/.github/workflows/benchmarks.yml | 4 ++-- barretenberg/cpp/src/barretenberg/benchmark/CMakeLists.txt | 2 +- .../benchmark/{honk_bench => ultra_bench}/CMakeLists.txt | 0 .../{honk_bench => ultra_bench}/benchmark_utilities.hpp | 0 .../compare_honk_to_plonk_ultra.sh | 2 +- .../benchmark/{honk_bench => ultra_bench}/eccvm.bench.cpp | 2 +- .../benchmark/{honk_bench => ultra_bench}/goblin.bench.cpp | 2 +- .../benchmark/{honk_bench => ultra_bench}/main.bench.cpp | 0 .../{honk_bench => ultra_bench}/standard_plonk.bench.cpp | 2 +- .../{honk_bench => ultra_bench}/ultra_honk.bench.cpp | 2 +- .../{honk_bench => ultra_bench}/ultra_honk_rounds.bench.cpp | 2 +- .../{honk_bench => ultra_bench}/ultra_plonk.bench.cpp | 2 +- .../{honk_bench => ultra_bench}/ultra_plonk_rounds.bench.cpp | 2 +- .../src/barretenberg/benchmark/widgets_bench/widget.bench.cpp | 2 +- 14 files changed, 12 insertions(+), 12 deletions(-) rename barretenberg/cpp/src/barretenberg/benchmark/{honk_bench => ultra_bench}/CMakeLists.txt (100%) rename barretenberg/cpp/src/barretenberg/benchmark/{honk_bench => ultra_bench}/benchmark_utilities.hpp (100%) rename barretenberg/cpp/src/barretenberg/benchmark/{honk_bench => ultra_bench}/compare_honk_to_plonk_ultra.sh (96%) rename barretenberg/cpp/src/barretenberg/benchmark/{honk_bench => ultra_bench}/eccvm.bench.cpp (97%) rename barretenberg/cpp/src/barretenberg/benchmark/{honk_bench => ultra_bench}/goblin.bench.cpp (98%) rename barretenberg/cpp/src/barretenberg/benchmark/{honk_bench => ultra_bench}/main.bench.cpp (100%) rename barretenberg/cpp/src/barretenberg/benchmark/{honk_bench => ultra_bench}/standard_plonk.bench.cpp (92%) rename barretenberg/cpp/src/barretenberg/benchmark/{honk_bench => ultra_bench}/ultra_honk.bench.cpp (96%) rename barretenberg/cpp/src/barretenberg/benchmark/{honk_bench => ultra_bench}/ultra_honk_rounds.bench.cpp (98%) rename barretenberg/cpp/src/barretenberg/benchmark/{honk_bench => ultra_bench}/ultra_plonk.bench.cpp (96%) rename barretenberg/cpp/src/barretenberg/benchmark/{honk_bench => ultra_bench}/ultra_plonk_rounds.bench.cpp (98%) diff --git a/barretenberg/.github/workflows/benchmarks.yml b/barretenberg/.github/workflows/benchmarks.yml index 9d70efdcb47..b3a7afdf2b3 100644 --- a/barretenberg/.github/workflows/benchmarks.yml +++ b/barretenberg/.github/workflows/benchmarks.yml @@ -43,7 +43,7 @@ jobs: - name: Run Honk benchmarks working-directory: cpp/build-bench run: | - bin/ultra_honk_bench --benchmark_format=json > ../src/barretenberg/benchmark/honk_bench/bench_results.json + bin/ultra_honk_bench --benchmark_format=json > ../src/barretenberg/benchmark/ultra_bench/bench_results.json # Utilize github-action-benchmark to automatically update the plots at # https://aztecprotocol.github.io/barretenberg/dev/bench/ with new benchmark data. @@ -53,7 +53,7 @@ jobs: with: name: C++ Benchmark tool: 'googlecpp' - output-file-path: cpp/src/barretenberg/benchmark/honk_bench/bench_results.json + output-file-path: cpp/src/barretenberg/benchmark/ultra_bench/bench_results.json # Access token to deploy GitHub Pages branch github-token: ${{ secrets.GITHUB_TOKEN }} # Push and deploy GitHub pages branch automatically diff --git a/barretenberg/cpp/src/barretenberg/benchmark/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/CMakeLists.txt index bfba40b03b4..6b218cdd7ee 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/benchmark/CMakeLists.txt @@ -1,6 +1,6 @@ add_subdirectory(decrypt_bench) add_subdirectory(pippenger_bench) add_subdirectory(plonk_bench) -add_subdirectory(honk_bench) +add_subdirectory(ultra_bench) add_subdirectory(relations_bench) add_subdirectory(widgets_bench) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/CMakeLists.txt similarity index 100% rename from barretenberg/cpp/src/barretenberg/benchmark/honk_bench/CMakeLists.txt rename to barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/CMakeLists.txt diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/benchmark_utilities.hpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/benchmark_utilities.hpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/benchmark/honk_bench/benchmark_utilities.hpp rename to barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/benchmark_utilities.hpp diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/compare_honk_to_plonk_ultra.sh b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/compare_honk_to_plonk_ultra.sh similarity index 96% rename from barretenberg/cpp/src/barretenberg/benchmark/honk_bench/compare_honk_to_plonk_ultra.sh rename to barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/compare_honk_to_plonk_ultra.sh index f97dbc0eaa7..3b4e69d5dc3 100755 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/compare_honk_to_plonk_ultra.sh +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/compare_honk_to_plonk_ultra.sh @@ -30,7 +30,7 @@ PLONK_BENCH_RESULTS="$BENCH_RESULTS_DIR/plonk_bench.json" cd .. cmake --preset bench > /dev/null && cmake --build --preset bench --target ultra_honk_bench cd build-bench -HONK_BENCH_RESULTS="$BENCH_RESULTS_DIR/honk_bench.json" +HONK_BENCH_RESULTS="$BENCH_RESULTS_DIR/ultra_bench.json" ./bin/ultra_honk_bench --benchmark_format=json > $HONK_BENCH_RESULTS # Call compare.py on the results (json) to get high level statistics. diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/eccvm.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/eccvm.bench.cpp similarity index 97% rename from barretenberg/cpp/src/barretenberg/benchmark/honk_bench/eccvm.bench.cpp rename to barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/eccvm.bench.cpp index d27bd0d06b4..8631a1a550d 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/eccvm.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/eccvm.bench.cpp @@ -1,6 +1,6 @@ #include -#include "barretenberg/benchmark/honk_bench/benchmark_utilities.hpp" +#include "barretenberg/benchmark/ultra_bench/benchmark_utilities.hpp" #include "barretenberg/eccvm/eccvm_composer.hpp" #include "barretenberg/proof_system/circuit_builder/eccvm/eccvm_circuit_builder.hpp" diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/goblin.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/goblin.bench.cpp similarity index 98% rename from barretenberg/cpp/src/barretenberg/benchmark/honk_bench/goblin.bench.cpp rename to barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/goblin.bench.cpp index 366f2ab6a24..2ed5897aa00 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/goblin.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/goblin.bench.cpp @@ -1,7 +1,7 @@ #include -#include "barretenberg/benchmark/honk_bench/benchmark_utilities.hpp" +#include "barretenberg/benchmark/ultra_bench/benchmark_utilities.hpp" #include "barretenberg/goblin/goblin.hpp" #include "barretenberg/goblin/mock_circuits.hpp" #include "barretenberg/proof_system/circuit_builder/ultra_circuit_builder.hpp" diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/main.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/main.bench.cpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/benchmark/honk_bench/main.bench.cpp rename to barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/main.bench.cpp diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/standard_plonk.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/standard_plonk.bench.cpp similarity index 92% rename from barretenberg/cpp/src/barretenberg/benchmark/honk_bench/standard_plonk.bench.cpp rename to barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/standard_plonk.bench.cpp index b44f4123f61..09bd5ccd2ea 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/standard_plonk.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/standard_plonk.bench.cpp @@ -1,4 +1,4 @@ -#include "barretenberg/benchmark/honk_bench/benchmark_utilities.hpp" +#include "barretenberg/benchmark/ultra_bench/benchmark_utilities.hpp" #include "barretenberg/plonk/composer/standard_composer.hpp" #include "barretenberg/proof_system/circuit_builder/standard_circuit_builder.hpp" diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_honk.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_honk.bench.cpp similarity index 96% rename from barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_honk.bench.cpp rename to barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_honk.bench.cpp index 471e7db76e0..e01487440b1 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_honk.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_honk.bench.cpp @@ -1,6 +1,6 @@ #include -#include "barretenberg/benchmark/honk_bench/benchmark_utilities.hpp" +#include "barretenberg/benchmark/ultra_bench/benchmark_utilities.hpp" #include "barretenberg/proof_system/circuit_builder/ultra_circuit_builder.hpp" #include "barretenberg/ultra_honk/ultra_composer.hpp" diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_honk_rounds.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_honk_rounds.bench.cpp similarity index 98% rename from barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_honk_rounds.bench.cpp rename to barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_honk_rounds.bench.cpp index a406c1a8591..2552a8bc406 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_honk_rounds.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_honk_rounds.bench.cpp @@ -1,6 +1,6 @@ #include -#include "barretenberg/benchmark/honk_bench/benchmark_utilities.hpp" +#include "barretenberg/benchmark/ultra_bench/benchmark_utilities.hpp" #include "barretenberg/proof_system/circuit_builder/ultra_circuit_builder.hpp" #include "barretenberg/ultra_honk/ultra_composer.hpp" #include "barretenberg/ultra_honk/ultra_prover.hpp" diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_plonk.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_plonk.bench.cpp similarity index 96% rename from barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_plonk.bench.cpp rename to barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_plonk.bench.cpp index 9ea895fe703..7c44c18296b 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_plonk.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_plonk.bench.cpp @@ -1,4 +1,4 @@ -#include "barretenberg/benchmark/honk_bench/benchmark_utilities.hpp" +#include "barretenberg/benchmark/ultra_bench/benchmark_utilities.hpp" #include "barretenberg/plonk/composer/ultra_composer.hpp" #include "barretenberg/proof_system/circuit_builder/ultra_circuit_builder.hpp" diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_plonk_rounds.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_plonk_rounds.bench.cpp similarity index 98% rename from barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_plonk_rounds.bench.cpp rename to barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_plonk_rounds.bench.cpp index 0db10eea970..63a70c7625c 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/ultra_plonk_rounds.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_plonk_rounds.bench.cpp @@ -1,6 +1,6 @@ #include -#include "barretenberg/benchmark/honk_bench/benchmark_utilities.hpp" +#include "barretenberg/benchmark/ultra_bench/benchmark_utilities.hpp" #include "barretenberg/proof_system/circuit_builder/ultra_circuit_builder.hpp" using namespace benchmark; diff --git a/barretenberg/cpp/src/barretenberg/benchmark/widgets_bench/widget.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/widgets_bench/widget.bench.cpp index 454625eafd8..59cd739fce4 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/widgets_bench/widget.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/widgets_bench/widget.bench.cpp @@ -1,4 +1,4 @@ -#include "barretenberg/benchmark/honk_bench/benchmark_utilities.hpp" +#include "barretenberg/benchmark/ultra_bench/benchmark_utilities.hpp" #include "barretenberg/flavor/goblin_ultra.hpp" #include "barretenberg/flavor/ultra.hpp" #include "barretenberg/plonk/composer/standard_composer.hpp" From 5938b3e03d1baff823e68eb9214580f79d7bf7d2 Mon Sep 17 00:00:00 2001 From: codygunton Date: Tue, 9 Jan 2024 20:51:33 +0000 Subject: [PATCH 2/3] Split out goblin benchmarks --- .../src/barretenberg/benchmark/CMakeLists.txt | 1 + .../benchmark/goblin_bench/CMakeLists.txt | 21 +++++++++++++++++++ .../eccvm.bench.cpp | 0 .../goblin.bench.cpp | 0 .../benchmark/goblin_bench/main.bench.cpp | 3 +++ .../benchmark/ultra_bench/CMakeLists.txt | 5 +---- 6 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/CMakeLists.txt rename barretenberg/cpp/src/barretenberg/benchmark/{ultra_bench => goblin_bench}/eccvm.bench.cpp (100%) rename barretenberg/cpp/src/barretenberg/benchmark/{ultra_bench => goblin_bench}/goblin.bench.cpp (100%) create mode 100644 barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/main.bench.cpp diff --git a/barretenberg/cpp/src/barretenberg/benchmark/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/CMakeLists.txt index 6b218cdd7ee..49bcb251f07 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/benchmark/CMakeLists.txt @@ -2,5 +2,6 @@ add_subdirectory(decrypt_bench) add_subdirectory(pippenger_bench) add_subdirectory(plonk_bench) add_subdirectory(ultra_bench) +add_subdirectory(goblin_bench) add_subdirectory(relations_bench) add_subdirectory(widgets_bench) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/CMakeLists.txt new file mode 100644 index 00000000000..5b3734936f2 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/CMakeLists.txt @@ -0,0 +1,21 @@ +# Each source represents a separate benchmark suite +set(BENCHMARK_SOURCES + goblin.bench.cpp + eccvm.bench.cpp +) + +# Required libraries for benchmark suites +set(LINKED_LIBRARIES + ultra_honk + eccvm + stdlib_recursion + benchmark::benchmark +) + +# Add executable and custom target for each suite, e.g. ultra_honk_bench +foreach(BENCHMARK_SOURCE ${BENCHMARK_SOURCES}) + get_filename_component(BENCHMARK_NAME ${BENCHMARK_SOURCE} NAME_WE) # extract name without extension + add_executable(${BENCHMARK_NAME}_bench main.bench.cpp ${BENCHMARK_SOURCE}) + target_link_libraries(${BENCHMARK_NAME}_bench ${LINKED_LIBRARIES}) + add_custom_target(run_${BENCHMARK_NAME} COMMAND ${BENCHMARK_NAME} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +endforeach() \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/eccvm.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/eccvm.bench.cpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/eccvm.bench.cpp rename to barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/eccvm.bench.cpp diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/goblin.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/goblin.bench.cpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/goblin.bench.cpp rename to barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/goblin.bench.cpp diff --git a/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/main.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/main.bench.cpp new file mode 100644 index 00000000000..71fefa04722 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/main.bench.cpp @@ -0,0 +1,3 @@ +#include + +BENCHMARK_MAIN(); diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/CMakeLists.txt index 8984bc7b0ff..7c98a9ca23b 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/CMakeLists.txt @@ -1,8 +1,6 @@ # Each source represents a separate benchmark suite set(BENCHMARK_SOURCES standard_plonk.bench.cpp - goblin.bench.cpp - eccvm.bench.cpp ultra_honk.bench.cpp ultra_honk_rounds.bench.cpp ultra_plonk.bench.cpp @@ -12,7 +10,6 @@ set(BENCHMARK_SOURCES # Required libraries for benchmark suites set(LINKED_LIBRARIES ultra_honk - eccvm stdlib_sha256 stdlib_keccak stdlib_merkle_tree @@ -23,7 +20,7 @@ set(LINKED_LIBRARIES # Add executable and custom target for each suite, e.g. ultra_honk_bench foreach(BENCHMARK_SOURCE ${BENCHMARK_SOURCES}) get_filename_component(BENCHMARK_NAME ${BENCHMARK_SOURCE} NAME_WE) # extract name without extension - add_executable(${BENCHMARK_NAME}_bench main.bench.cpp ${BENCHMARK_SOURCE} benchmark_utilities.hpp) + add_executable(${BENCHMARK_NAME}_bench main.bench.cpp ${BENCHMARK_SOURCE}) target_link_libraries(${BENCHMARK_NAME}_bench ${LINKED_LIBRARIES}) add_custom_target(run_${BENCHMARK_NAME} COMMAND ${BENCHMARK_NAME} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) endforeach() \ No newline at end of file From 8a09a52c25e9e62a448bf5cd9159241b5f12de09 Mon Sep 17 00:00:00 2001 From: codygunton Date: Tue, 9 Jan 2024 20:59:07 +0000 Subject: [PATCH 3/3] Move standard plonk benchmarks --- .../benchmark/plonk_bench/CMakeLists.txt | 23 ++++++++++++------- .../benchmark/plonk_bench/main.bench.cpp | 3 +++ .../benchmark/plonk_bench/plonk.bench.cpp | 4 +--- .../standard_plonk.bench.cpp | 0 .../benchmark/ultra_bench/CMakeLists.txt | 1 - 5 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/main.bench.cpp rename barretenberg/cpp/src/barretenberg/benchmark/{ultra_bench => plonk_bench}/standard_plonk.bench.cpp (100%) diff --git a/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/CMakeLists.txt index 2f31ffc518b..0746ecaa44e 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/CMakeLists.txt @@ -1,13 +1,20 @@ -add_executable(plonk_bench plonk.bench.cpp) +# Each source represents a separate benchmark suite +set(BENCHMARK_SOURCES + plonk.bench.cpp + standard_plonk.bench.cpp +) -target_link_libraries( - plonk_bench +# Required libraries for benchmark suites +set(LINKED_LIBRARIES + plonk stdlib_primitives benchmark::benchmark ) -add_custom_target( - run_plonk_bench - COMMAND plonk_bench - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} -) \ No newline at end of file +# Add executable and custom target for each suite, e.g. ultra_honk_bench +foreach(BENCHMARK_SOURCE ${BENCHMARK_SOURCES}) + get_filename_component(BENCHMARK_NAME ${BENCHMARK_SOURCE} NAME_WE) # extract name without extension + add_executable(${BENCHMARK_NAME}_bench main.bench.cpp ${BENCHMARK_SOURCE}) + target_link_libraries(${BENCHMARK_NAME}_bench ${LINKED_LIBRARIES}) + add_custom_target(run_${BENCHMARK_NAME} COMMAND ${BENCHMARK_NAME} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +endforeach() diff --git a/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/main.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/main.bench.cpp new file mode 100644 index 00000000000..71fefa04722 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/main.bench.cpp @@ -0,0 +1,3 @@ +#include + +BENCHMARK_MAIN(); diff --git a/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/plonk.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/plonk.bench.cpp index add4ec750a6..27989435cb6 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/plonk.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/plonk.bench.cpp @@ -107,6 +107,4 @@ void verify_proofs_bench(State& state) noexcept state.ResumeTiming(); } } -BENCHMARK(verify_proofs_bench)->RangeMultiplier(2)->Range(START, MAX_GATES); - -BENCHMARK_MAIN(); +BENCHMARK(verify_proofs_bench)->RangeMultiplier(2)->Range(START, MAX_GATES); \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/standard_plonk.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/standard_plonk.bench.cpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/standard_plonk.bench.cpp rename to barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/standard_plonk.bench.cpp diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/CMakeLists.txt index 7c98a9ca23b..9c0826d009c 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/CMakeLists.txt @@ -1,6 +1,5 @@ # Each source represents a separate benchmark suite set(BENCHMARK_SOURCES - standard_plonk.bench.cpp ultra_honk.bench.cpp ultra_honk_rounds.bench.cpp ultra_plonk.bench.cpp