Skip to content

Commit b62cd2f

Browse files
committed
chore: Split benchmarks
Split benchmarks into two jobs, so we can run them more often.
1 parent b34b5fb commit b62cd2f

File tree

2 files changed

+39
-4
lines changed

2 files changed

+39
-4
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,37 @@ jobs:
140140

141141
- name: Benchmark tests
142142
run: |
143-
BENCHSTAT_OUTPUT_FILE=result.txt make test-benchmark-compare
143+
BENCHSTAT_OUTPUT_FILE=result.txt make test-benchmark-compare-main
144144
- run: |
145+
echo "Comparison against main branch" >> "$GITHUB_STEP_SUMMARY"
146+
echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY"
147+
cat result.txt >> "$GITHUB_STEP_SUMMARY"
148+
echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY"
149+
cat <<EOL >> "$GITHUB_STEP_SUMMARY"
150+
<hr />
151+
The table shows the median and 95% confidence interval (CI) summaries for each benchmark comparing the HEAD and the BASE, and an A/B comparison under "vs base". The last column shows the statistical p-value with ten runs (n=10).
152+
The last row has the Geometric Mean (geomean) for the given rows in the table.
153+
Refer to <a href="https://pkg.go.dev/golang.org/x/perf/cmd/benchstat">benchstat's documentation</a> for more help.
154+
EOL
155+
156+
ci-benchmark-tests-release:
157+
name: ci-benchmark-tests-releasebranch
158+
runs-on: ubuntu-latest
159+
steps:
160+
- name: Check out code into the Go module directory
161+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
162+
163+
- name: Set up Go 1.x
164+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
165+
with:
166+
go-version: ${{ env.GO_VERSION }}
167+
id: go
168+
169+
- name: Benchmark tests
170+
run: |
171+
BENCHSTAT_OUTPUT_FILE=result.txt make test-benchmark-compare-release
172+
- run: |
173+
echo "Comparison against release branch" >> "$GITHUB_STEP_SUMMARY"
145174
echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY"
146175
cat result.txt >> "$GITHUB_STEP_SUMMARY"
147176
echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY"

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,15 @@ validate-template: generate-template
101101
# Runs benchmark tests on the current git ref and the last release and compares
102102
# the two.
103103
test-benchmark-compare:
104-
@git fetch
105-
./tests/compare_benchmarks.sh main 2
106-
./tests/compare_benchmarks.sh ${LATEST_RELEASE_BRANCH} 2
104+
$(MAKE) test-benchmark-compare-main test-benchmark-compare-release
105+
106+
test-benchmark-compare-main:
107+
@git fetch origin main
108+
./tests/compare_benchmarks.sh main 6
109+
110+
test-benchmark-compare-release:
111+
@git fetch origin ${LATEST_RELEASE_BRANCH}
112+
./tests/compare_benchmarks.sh ${LATEST_RELEASE_BRANCH} 6
107113

108114
all: all-container
109115

0 commit comments

Comments
 (0)