Skip to content

shadowfork: dbfork mutation engine + LevelDB/RocksDB e2e #53

shadowfork: dbfork mutation engine + LevelDB/RocksDB e2e

shadowfork: dbfork mutation engine + LevelDB/RocksDB e2e #53

Workflow file for this run

name: Bench Regression
# Compares hot-path benchmarks (intent.Load, render.RenderHOCON, etc.)
# between the PR branch and the merge target. Doesn't fail the PR —
# just surfaces the comparison as a comment so reviewers can spot
# unexpected regressions.
#
# 1.5x slowdown is the warning threshold; benchstat's significance
# test handles noise filtering.
on:
pull_request:
branches: [master, develop]
permissions:
contents: read
pull-requests: write
jobs:
benchstat:
name: benchstat vs base
runs-on: ubuntu-latest
# Benchmarks are flaky on shared GitHub runners; we run with a
# higher count to dampen noise but accept the result is a
# qualitative signal, not a precise number.
timeout-minutes: 20
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.25"
cache: true
- name: Install benchstat
run: go install golang.org/x/perf/cmd/benchstat@latest
- name: Run PR benchmarks
run: |
go test -bench=. -benchmem -count=10 -run=NONE \
./internal/intent/ ./internal/render/ \
> pr.txt
cat pr.txt
- name: Run base benchmarks
run: |
git fetch origin ${{ github.base_ref }}
git checkout origin/${{ github.base_ref }}
go test -bench=. -benchmem -count=10 -run=NONE \
./internal/intent/ ./internal/render/ \
> base.txt 2>/dev/null || echo "base bench failed (acceptable on first introduction)" > base.txt
cat base.txt
- name: Compare with benchstat
id: compare
run: |
{
echo "## Benchmark comparison: \`${{ github.base_ref }}\` → PR"
echo
echo '```'
benchstat base.txt pr.txt 2>&1 || true
echo '```'
} > comment.md
cat comment.md
- name: Post comment
uses: peter-evans/create-or-update-comment@v4
if: always()
continue-on-error: true
with:
issue-number: ${{ github.event.pull_request.number }}
body-file: comment.md