diff --git a/cpp/src/barretenberg/benchmark/honk_bench/compare_honk_branch_vs_master.sh b/cpp/src/barretenberg/benchmark/honk_bench/compare_honk_branch_vs_baseline.sh similarity index 51% rename from cpp/src/barretenberg/benchmark/honk_bench/compare_honk_branch_vs_master.sh rename to cpp/src/barretenberg/benchmark/honk_bench/compare_honk_branch_vs_baseline.sh index f76b70126a..47add30894 100755 --- a/cpp/src/barretenberg/benchmark/honk_bench/compare_honk_branch_vs_master.sh +++ b/cpp/src/barretenberg/benchmark/honk_bench/compare_honk_branch_vs_baseline.sh @@ -1,13 +1,17 @@ #!/bin/bash -# This script is used to compare the honk benchmarks between baseline (master) and +# This script is used to compare the honk benchmarks between baseline (default: 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. -echo -e '\nComparing Honk benchmarks between master and current branch:' +# Specify the benchmark suite and the "baseline" branch against which to compare +BENCH_TARGET="ultra_honk_bench" +BASELINE_BRANCH="master" + +echo -e "\nComparing $BENCH_TARGET between $BASELINE_BRANCH and current branch:" # Set some directories BASE_DIR="$HOME/barretenberg/cpp" -BUILD_DIR="$BASE_DIR/build-bench" +BUILD_DIR="$BASE_DIR/build-bench" # matches build dir specified in bench preset BENCH_RESULTS_DIR="$BASE_DIR/tmp_bench_results" BENCH_TOOLS_DIR="$BUILD_DIR/_deps/benchmark-src/tools" @@ -15,33 +19,33 @@ BENCH_TOOLS_DIR="$BUILD_DIR/_deps/benchmark-src/tools" # Note: By default, installation will occur in $HOME/.local/bin. pip3 install -r $BUILD_DIR/_deps/benchmark-src/requirements.txt -# Create temporary directory for honk_bench results (json) +# Create temporary directory for benchmark results (json) cd $BASE_DIR mkdir $BENCH_RESULTS_DIR -# Checkout master, run benchmarks, save results in json format -echo -e '\nConfiguring and building benchmarks in master branch..' +# Checkout baseline branch, run benchmarks, save results in json format +echo -e "\nConfiguring and building $BENCH_TARGET in $BASELINE_BRANCH branch..\n" git checkout master > /dev/null 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 $BENCH_TARGET cd build-bench -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 +BASELINE_RESULTS="$BENCH_RESULTS_DIR/results_baseline.json" +echo -e "\nRunning $BENCH_TARGET in master.." +bin/$BENCH_TARGET --benchmark_format=json > $BASELINE_RESULTS # Checkout working branch (-), run benchmarks, save results in json format -echo -e '\nConfiguring and building benchmarks in current feature branch..' +echo -e "\nConfiguring and building $BENCH_TARGET in current feature branch..\n" git checkout - rm -rf $BUILD_DIR -cmake --preset bench > /dev/null && cmake --build --preset bench --target honk_bench +cmake --preset bench > /dev/null && cmake --build --preset bench --target $BENCH_TARGET cd build-bench -BRANCH_HONK_BENCH_RESULTS="$BENCH_RESULTS_DIR/honk_bench_results_branch.json" -echo -e '\nRunning honk_bench in feature branch..' -bin/ultra_honk_bench --benchmark_format=json > $BRANCH_HONK_BENCH_RESULTS +BRANCH_RESULTS="$BENCH_RESULTS_DIR/results_branch.json" +echo -e "\nRunning $BENCH_TARGET in feature branch.." +bin/$BENCH_TARGET --benchmark_format=json > $BRANCH_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. -$BENCH_TOOLS_DIR/compare.py benchmarks $MASTER_HONK_BENCH_RESULTS $BRANCH_HONK_BENCH_RESULTS +$BENCH_TOOLS_DIR/compare.py benchmarks $BASELINE_RESULTS $BRANCH_RESULTS # Delete the temporary results directory and its contents -rm -r $BENCH_RESULTS_DIR \ No newline at end of file +rm -r $BENCH_RESULTS_DIR