Skip to content

Commit

Permalink
Try running a basic comparison benchmark between base and pr commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gruuya committed Mar 5, 2024
1 parent ac27428 commit 340eb41
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/benchmarks/pr_benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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: Setup data and benchmark PR changes
uses: actions/checkout@v4
run: |
cd benchmarks
./bench.sh data tpch10
./bench.sh data clickbench_1
./bench.sh run tpch10
./bench.sh run clickbench_1
- name: Benchmark baseline and compare
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.sha }}
run: |
cd benchmarks
./bench.sh run tpch10
./bench.sh run clickbench_1
pip3 install rich
./bench.sh compare ${{ github.event.pull_request.base.ref }}" ${{ github.ref }}"
4 changes: 2 additions & 2 deletions benchmarks/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ main() {
esac
;;
run)
# Parse positional paraleters
# Parse positional parameters
BENCHMARK=${ARG2:-"${BENCHMARK}"}
BRANCH_NAME=$(cd ${DATAFUSION_DIR} && git rev-parse --abbrev-ref HEAD)
BRANCH_NAME=${BRANCH_NAME//\//_} # mind blowing syntax to replace / with _
Expand All @@ -177,7 +177,7 @@ main() {
echo "COMMAND: ${COMMAND}"
echo "BENCHMARK: ${BENCHMARK}"
echo "DATAFUSION_DIR: ${DATAFUSION_DIR}"
echo "BRACH_NAME: ${BRANCH_NAME}"
echo "BRANCH_NAME: ${BRANCH_NAME}"
echo "DATA_DIR: ${DATA_DIR}"
echo "RESULTS_DIR: ${RESULTS_DIR}"
echo "CARGO_COMMAND: ${CARGO_COMMAND}"
Expand Down
3 changes: 3 additions & 0 deletions datafusion/physical-plan/src/sorts/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,9 @@ impl ExecutionPlan for SortExec {
let batch = batch?;
topk.insert_batch(batch)?;
}
// Test whether benchmarks catch this
// TODO: remove before merge!
tokio::time::sleep(std::time::Duration::from_secs(3)).await;
topk.emit()
})
.try_flatten(),
Expand Down

0 comments on commit 340eb41

Please sign in to comment.