forked from apache/datafusion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try running a basic comparison benchmark between base and pr commit
- Loading branch information
Showing
3 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Run and Cache Benchmarks | ||
|
||
on: | ||
pull_request: | ||
types: [labeled, opened, reopened, synchronize] | ||
|
||
jobs: | ||
benchmark: | ||
name: Run Benchmarks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Dump GitHub context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJSON(github) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
|
||
- name: Checkout PR changes | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup data and generate unique result names | ||
run: | | ||
cd benchmarks | ||
mkdir data | ||
# Setup the TPC-H data set with a scale factor of 10. | ||
# Hack: pipe the output and explicitly pre-prend a carriage | ||
# return to avoid the output staircase effect (e.g. percentage | ||
# updates appearing on subsequent lines). | ||
./bench.sh data tpch | | awk '{printf "\r%s", $0; fflush();}' | ||
# Generate a unique-ish identifier for the results using | ||
# branch name and commit sha | ||
short_ref=$(echo "${{ github.head_ref }}" | cut -c1-20) | ||
short_sha=$(echo "${{ github.sha }}" | cut -c1-7) | ||
echo "HEAD_REF_SHA=$short_ref-$short_sha" >> "$GITHUB_ENV" | ||
short_sha=$(echo "${{ github.pull_request.base.sha }}" | cut -c1-7) | ||
echo "BASE_REF_SHA=${{ github.base_ref }}-$short_sha" >> "$GITHUB_ENV" | ||
- name: Benchmark PR changes | ||
run: | | ||
cd benchmarks | ||
RESULTS_NAME=$HEAD_REF_SHA ./bench.sh run tpch | ||
- name: Checkout base commit | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.base.sha }} | ||
clean: false | ||
|
||
- name: Benchmark baseline and compare | ||
run: | | ||
cd benchmarks | ||
RESULTS_NAME=$BASE_REF_SHA ./bench.sh run tpch | ||
pip3 install rich | ||
./bench.sh compare $BASE_REF_SHA $HEAD_REF_SHA |
This file contains 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
This file contains 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