Skip to content

Commit

Permalink
rename and cleanup cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
ledwards2225 committed Jun 6, 2023
1 parent d1d02ff commit 2592445
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 143 deletions.
71 changes: 15 additions & 56 deletions cpp/src/barretenberg/benchmark/honk_bench/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,65 +1,24 @@
add_executable(standard_honk_bench main.bench.cpp standard_honk.bench.cpp)
add_executable(standard_plonk_bench main.bench.cpp standard_plonk.bench.cpp)
add_executable(ultra_honk_bench main.bench.cpp ultra_honk.bench.cpp)
add_executable(ultra_plonk_bench main.bench.cpp ultra_plonk.bench.cpp)

target_link_libraries(
standard_honk_bench
stdlib_primitives
stdlib_sha256
stdlib_keccak
stdlib_merkle_tree
env
benchmark::benchmark
# Each source represents a separate benchmark suite
set(BENCHMARK_SOURCES
standard_honk.bench.cpp
standard_plonk.bench.cpp
ultra_honk.bench.cpp
ultra_plonk.bench.cpp
)

target_link_libraries(
standard_plonk_bench
# Required libraries for benchmark suites
set(LINKED_LIBRARIES
stdlib_primitives
stdlib_sha256
stdlib_keccak
stdlib_merkle_tree
env
benchmark::benchmark
)

target_link_libraries(
ultra_honk_bench
stdlib_primitives
stdlib_sha256
stdlib_keccak
stdlib_merkle_tree
env
benchmark::benchmark
)

target_link_libraries(
ultra_plonk_bench
stdlib_primitives
stdlib_sha256
stdlib_keccak
stdlib_merkle_tree
env
benchmark::benchmark
)

add_custom_target(
run_standard_honk_bench
COMMAND standard_honk_bench
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_target(
run_standard_plonk_bench
COMMAND standard_plonk_bench
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_target(
run_ultra_honk_bench
COMMAND ultra_honk_bench
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_target(
run_ultra_plonk_bench
COMMAND ultra_plonk_bench
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
# Add executable and custom target for each suite, e.g. standard_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()
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# This script is used to compare the results of honk_bench between baseline (master) and
# This script is used to compare the honk benchmarks between baseline (master) and
# the branch from which the script is run. Simply check out the branch of interest, ensure
# it is up to date with local master, and run the script.

Expand All @@ -19,8 +19,8 @@ pip3 install -r $BUILD_DIR/_deps/benchmark-src/requirements.txt
cd $BASE_DIR
mkdir $BENCH_RESULTS_DIR

# Checkout master, run honk_bench, save results in json format
echo -e '\nConfiguring and building honk_bench in master branch..'
# Checkout master, run benchmarks, save results in json format
echo -e '\nConfiguring and building benchmarks in master branch..'
git checkout master > /dev/null
rm -rf $BUILD_DIR
cmake --preset bench > /dev/null && cmake --build --preset bench --target honk_bench > /dev/null
Expand All @@ -29,15 +29,15 @@ MASTER_HONK_BENCH_RESULTS="$BENCH_RESULTS_DIR/honk_bench_results_master.json"
echo -e '\nRunning honk_bench in master..'
bin/honk_bench --benchmark_format=json > $MASTER_HONK_BENCH_RESULTS

# Checkout working branch (-), run honk_bench, save results in json format
echo -e '\nConfiguring and building honk_bench in current feature branch..'
# Checkout working branch (-), run benchmarks, save results in json format
echo -e '\nConfiguring and building benchmarks in current feature branch..'
git checkout -
rm -rf $BUILD_DIR
cmake --preset bench > /dev/null && cmake --build --preset bench --target honk_bench > /dev/null
cmake --preset bench > /dev/null && cmake --build --preset bench --target honk_bench
cd build-bench
BRANCH_HONK_BENCH_RESULTS="$BENCH_RESULTS_DIR/honk_bench_results_branch.json"
echo -e '\nRunning honk_bench in feature branch..'
bin/honk_bench --benchmark_format=json > $BRANCH_HONK_BENCH_RESULTS
bin/ultra_honk_bench --benchmark_format=json > $BRANCH_HONK_BENCH_RESULTS

# Call compare.py on the results (json) to get high level statistics.
# See docs at https://github.com/google/benchmark/blob/main/docs/tools.md for more details.
Expand Down
20 changes: 0 additions & 20 deletions cpp/src/barretenberg/benchmark/honk_bench/standard_honk.bench.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
#include "barretenberg/crypto/ecdsa/ecdsa.hpp"
#include "barretenberg/ecc/curves/bn254/fr.hpp"
#include "barretenberg/honk/proof_system/ultra_prover.hpp"
#include "barretenberg/honk/proof_system/ultra_verifier.hpp"
#include <benchmark/benchmark.h>
#include <cstddef>
#include "barretenberg/honk/composer/standard_honk_composer.hpp"
#include "barretenberg/plonk/composer/standard_plonk_composer.hpp"
#include "barretenberg/stdlib/encryption/ecdsa/ecdsa.hpp"
#include "barretenberg/stdlib/hash/keccak/keccak.hpp"
#include "barretenberg/stdlib/primitives/curves/secp256k1.hpp"
#include "barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp"
#include "barretenberg/stdlib/hash/sha256/sha256.hpp"
#include "barretenberg/stdlib/primitives/bool/bool.hpp"
#include "barretenberg/stdlib/primitives/field/field.hpp"
#include "barretenberg/stdlib/primitives/witness/witness.hpp"
#include "barretenberg/stdlib/merkle_tree/merkle_tree.hpp"
#include "barretenberg/stdlib/merkle_tree/membership.hpp"
#include "barretenberg/stdlib/merkle_tree/memory_store.hpp"
#include "barretenberg/stdlib/merkle_tree/memory_tree.hpp"
#include "barretenberg/benchmark/honk_bench/benchmark_utilities.hpp"

using namespace benchmark;
Expand Down
20 changes: 0 additions & 20 deletions cpp/src/barretenberg/benchmark/honk_bench/standard_plonk.bench.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
#include "barretenberg/crypto/ecdsa/ecdsa.hpp"
#include "barretenberg/ecc/curves/bn254/fr.hpp"
#include "barretenberg/honk/proof_system/ultra_prover.hpp"
#include "barretenberg/honk/proof_system/ultra_verifier.hpp"
#include <benchmark/benchmark.h>
#include <cstddef>
#include "barretenberg/honk/composer/standard_honk_composer.hpp"
#include "barretenberg/plonk/composer/standard_plonk_composer.hpp"
#include "barretenberg/stdlib/encryption/ecdsa/ecdsa.hpp"
#include "barretenberg/stdlib/hash/keccak/keccak.hpp"
#include "barretenberg/stdlib/primitives/curves/secp256k1.hpp"
#include "barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp"
#include "barretenberg/stdlib/hash/sha256/sha256.hpp"
#include "barretenberg/stdlib/primitives/bool/bool.hpp"
#include "barretenberg/stdlib/primitives/field/field.hpp"
#include "barretenberg/stdlib/primitives/witness/witness.hpp"
#include "barretenberg/stdlib/merkle_tree/merkle_tree.hpp"
#include "barretenberg/stdlib/merkle_tree/membership.hpp"
#include "barretenberg/stdlib/merkle_tree/memory_store.hpp"
#include "barretenberg/stdlib/merkle_tree/memory_tree.hpp"
#include "barretenberg/benchmark/honk_bench/benchmark_utilities.hpp"

using namespace benchmark;
Expand Down
20 changes: 0 additions & 20 deletions cpp/src/barretenberg/benchmark/honk_bench/ultra_honk.bench.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
#include "barretenberg/crypto/ecdsa/ecdsa.hpp"
#include "barretenberg/ecc/curves/bn254/fr.hpp"
#include "barretenberg/honk/proof_system/ultra_prover.hpp"
#include "barretenberg/honk/proof_system/ultra_verifier.hpp"
#include <benchmark/benchmark.h>
#include <cstddef>
#include "barretenberg/honk/composer/ultra_honk_composer.hpp"
#include "barretenberg/plonk/composer/ultra_plonk_composer.hpp"
#include "barretenberg/stdlib/encryption/ecdsa/ecdsa.hpp"
#include "barretenberg/stdlib/hash/keccak/keccak.hpp"
#include "barretenberg/stdlib/primitives/curves/secp256k1.hpp"
#include "barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp"
#include "barretenberg/stdlib/hash/sha256/sha256.hpp"
#include "barretenberg/stdlib/primitives/bool/bool.hpp"
#include "barretenberg/stdlib/primitives/field/field.hpp"
#include "barretenberg/stdlib/primitives/witness/witness.hpp"
#include "barretenberg/stdlib/merkle_tree/merkle_tree.hpp"
#include "barretenberg/stdlib/merkle_tree/membership.hpp"
#include "barretenberg/stdlib/merkle_tree/memory_store.hpp"
#include "barretenberg/stdlib/merkle_tree/memory_tree.hpp"
#include "barretenberg/benchmark/honk_bench/benchmark_utilities.hpp"

using namespace benchmark;
Expand Down
20 changes: 0 additions & 20 deletions cpp/src/barretenberg/benchmark/honk_bench/ultra_plonk.bench.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
#include "barretenberg/crypto/ecdsa/ecdsa.hpp"
#include "barretenberg/ecc/curves/bn254/fr.hpp"
#include "barretenberg/honk/proof_system/ultra_prover.hpp"
#include "barretenberg/honk/proof_system/ultra_verifier.hpp"
#include <benchmark/benchmark.h>
#include <cstddef>
#include "barretenberg/honk/composer/ultra_honk_composer.hpp"
#include "barretenberg/plonk/composer/ultra_plonk_composer.hpp"
#include "barretenberg/stdlib/encryption/ecdsa/ecdsa.hpp"
#include "barretenberg/stdlib/hash/keccak/keccak.hpp"
#include "barretenberg/stdlib/primitives/curves/secp256k1.hpp"
#include "barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp"
#include "barretenberg/stdlib/hash/sha256/sha256.hpp"
#include "barretenberg/stdlib/primitives/bool/bool.hpp"
#include "barretenberg/stdlib/primitives/field/field.hpp"
#include "barretenberg/stdlib/primitives/witness/witness.hpp"
#include "barretenberg/stdlib/merkle_tree/merkle_tree.hpp"
#include "barretenberg/stdlib/merkle_tree/membership.hpp"
#include "barretenberg/stdlib/merkle_tree/memory_store.hpp"
#include "barretenberg/stdlib/merkle_tree/memory_tree.hpp"
#include "barretenberg/benchmark/honk_bench/benchmark_utilities.hpp"

using namespace benchmark;
Expand Down

0 comments on commit 2592445

Please sign in to comment.