Last active
October 24, 2025 13:44
-
-
Save Raimo33/b8f80e4df98da61d3c7b3da061e39eab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| N=${1:-1} | |
| FILTER=${2:-} | |
| TIME=${3:-} | |
| CURRENT_COMMIT=$(git rev-parse HEAD) | |
| COMMITS=$(git rev-list --max-count="$N" --reverse HEAD) | |
| trap 'git checkout -q "$CURRENT_COMMIT"' EXIT SIGINT SIGTERM | |
| RED="\033[0;31m" | |
| GREEN="\033[0;32m" | |
| YELLOW="\033[1;33m" | |
| NC="\033[0m" | |
| for COMMIT in $COMMITS; do | |
| git checkout -q "$COMMIT" | |
| COMMIT_MSG=$(git log -1 --pretty=format:"%s") | |
| echo -en "${YELLOW}Benchmarking commit ${COMMIT}: '${COMMIT_MSG}'${NC}" | |
| rm -rf build | |
| cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_BENCH=ON >/dev/null 2>&1 | |
| ninja -C build bench_bitcoin >/dev/null 2>&1 | |
| taskset -c 0 ./build/bin/bench_bitcoin --filter="${FILTER}" --min-time="${TIME}" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment