refactor: display verbose output for benchmark comparison (#1054)

* refactor: display verbose output for benchmark comparison

* refactor: use unique machine name for ci benchmarks
This commit is contained in:
Juro Oravec 2025-03-21 10:44:43 +01:00 committed by GitHub
parent ab75cfdb8f
commit 390211b86e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -71,7 +71,8 @@ jobs:
# We assume that the CI machine has a name that is unique and stable. # We assume that the CI machine has a name that is unique and stable.
# See https://github.com/airspeed-velocity/asv/issues/796#issuecomment-1188431794 # See https://github.com/airspeed-velocity/asv/issues/796#issuecomment-1188431794
echo "Preparing benchmarks profile..." echo "Preparing benchmarks profile..."
asv machine --yes MACHINE="ci_benchmark_${{ github.event.pull_request.number }}"
asv machine --yes -v --machine ${MACHINE}
echo "Benchmarks profile DONE." echo "Benchmarks profile DONE."
# Generate benchmark data # Generate benchmark data
@ -83,20 +84,23 @@ jobs:
# TO the start of the branch history. # TO the start of the branch history.
# With it, we run benchmarks ONLY FOR the latest commit. # With it, we run benchmarks ONLY FOR the latest commit.
echo "Running benchmarks for upstream/master..." echo "Running benchmarks for upstream/master..."
DJC_BENCHMARK_QUICK=1 asv run upstream/master^! -v DJC_BENCHMARK_QUICK=1 asv run upstream/master^! -v --machine ${MACHINE}
echo "Benchmarks for upstream/master DONE." echo "Benchmarks for upstream/master DONE."
echo "Running benchmarks for HEAD..." echo "Running benchmarks for HEAD..."
DJC_BENCHMARK_QUICK=1 asv run HEAD^! -v DJC_BENCHMARK_QUICK=1 asv run HEAD^! -v --machine ${MACHINE}
echo "Benchmarks for HEAD DONE." echo "Benchmarks for HEAD DONE."
# Compare against master echo "Creating pr directory..."
echo "Comparing benchmarks..."
mkdir -p pr mkdir -p pr
asv compare upstream/master HEAD --factor 1.1 --split > ./pr/benchmark_results.md
# Save the PR number to a file, so that it can be used by the next step. # Save the PR number to a file, so that it can be used by the next step.
echo "${{ github.event.pull_request.number }}" > ./pr/pr_number.txt echo "${{ github.event.pull_request.number }}" > ./pr/pr_number.txt
# Compare against master
# NOTE: The command is run twice, once so we can see the debug output, and once to save the results.
echo "Comparing benchmarks... (debug)"
asv compare upstream/master HEAD --factor 1.1 --split --machine ${MACHINE} --verbose
echo "Comparing benchmarks... (saving results)"
asv compare upstream/master HEAD --factor 1.1 --split --machine ${MACHINE} > ./pr/benchmark_results.md
echo "Benchmarks comparison DONE." echo "Benchmarks comparison DONE."
- name: Save benchmark results - name: Save benchmark results