Compose the named-stage master per object; harden cross-domain catalog pairing #3135
This file contains hidden or 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
| name: Benchmark | |
| on: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| int-keys: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| env: | |
| BENCH_RUNS: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| bash .github/scripts/install-apt-deps.sh tcl-dev build-essential zlib1g-dev | |
| - name: Configure | |
| run: | | |
| mkdir -p build && cd build | |
| TCL_CONFIG=$(find /usr -path '/usr/share/miniconda/*' -prune -o -name tclConfig.sh -print 2>/dev/null | head -1) | |
| if [ -n "$TCL_CONFIG" ]; then | |
| ../configure --with-tcl=$(dirname $TCL_CONFIG) | |
| else | |
| ../configure | |
| fi | |
| - name: Build doltlite and stock SQLite | |
| run: | | |
| cd build | |
| make doltlite | |
| make doltlite-lib | |
| cc -O2 -I. -I../src -o bench_timer_doltlite ../test/sysbench_timer.c libdoltlite.a -lpthread -lz -lm | |
| make DOLTLITE_PROLLY=0 sqlite3 sqlite3.o | |
| cc -O2 -I. -I../src -o bench_timer_sqlite ../test/sysbench_timer.c sqlite3.o -lpthread -lz -lm | |
| - name: Run benchmark | |
| id: bench | |
| run: | | |
| cd build | |
| # Capture script exit code separately from the output capture. | |
| # Piping to `tee` would mask a ceiling-check failure (tee always | |
| # exits 0), letting the job report green on a regression. Stash | |
| # the rc and propagate it after the PR-comment step has run, so | |
| # results are still visible on a failing run. | |
| set +e | |
| BENCH_SECTION_MODE=full bash ../test/sysbench_compare.sh > /tmp/bench_results.md | |
| bench_rc=$? | |
| set -e | |
| cat /tmp/bench_results.md | |
| echo "bench_rc=$bench_rc" >> "$GITHUB_OUTPUT" | |
| - name: Comment PR with results | |
| continue-on-error: true | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| // Read from file so the multi-line markdown (and any backticks / | |
| // template-literal-unsafe chars in it) never has to round-trip | |
| // through YAML scalars or JS template-literal parsing. | |
| const fs = require('fs'); | |
| const body = fs.readFileSync('/tmp/bench_results.md', 'utf8'); | |
| if (!context.issue.number) { | |
| console.log('No PR context (push event) — skipping comment'); | |
| return; | |
| } | |
| // Find existing classic benchmark comment | |
| const comments = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const botComment = comments.data.find(c => | |
| c.body.includes('<!-- benchmark:classic -->') || | |
| c.body.includes('## Sysbench-Style Benchmark: Doltlite vs SQLite') | |
| ); | |
| if (botComment) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: botComment.id, | |
| body: body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: body, | |
| }); | |
| } | |
| - name: Enforce ceiling | |
| run: | | |
| rc="${{ steps.bench.outputs.bench_rc }}" | |
| if [ "$rc" != "0" ]; then | |
| echo "Benchmark exceeded performance ceiling (rc=$rc)" >&2 | |
| exit "$rc" | |
| fi | |
| # Runs non-INTKEY sysbench variants as separate matrix jobs. At 100k rows | |
| # each suite is large enough that running all three serially risks hitting | |
| # the job timeout before benchmark results can be posted. | |
| non-int-keys: | |
| name: ${{ matrix.suite.name }}-keys | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| suite: | |
| - name: textpk | |
| script: sysbench_compare_textpk.sh | |
| output: /tmp/bench_textpk.md | |
| marker: '<!-- benchmark:textpk -->' | |
| - name: blobpk | |
| script: sysbench_compare_blobpk.sh | |
| output: /tmp/bench_blobpk.md | |
| marker: '<!-- benchmark:blobpk -->' | |
| - name: compositepk | |
| script: sysbench_compare_compositepk.sh | |
| output: /tmp/bench_compositepk.md | |
| marker: '<!-- benchmark:compositepk -->' | |
| env: | |
| BENCH_RUNS: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| bash .github/scripts/install-apt-deps.sh tcl-dev build-essential zlib1g-dev | |
| - name: Configure | |
| run: | | |
| mkdir -p build && cd build | |
| TCL_CONFIG=$(find /usr -path '/usr/share/miniconda/*' -prune -o -name tclConfig.sh -print 2>/dev/null | head -1) | |
| if [ -n "$TCL_CONFIG" ]; then | |
| ../configure --with-tcl=$(dirname $TCL_CONFIG) | |
| else | |
| ../configure | |
| fi | |
| - name: Build doltlite and stock SQLite | |
| run: | | |
| cd build | |
| make doltlite | |
| make doltlite-lib | |
| cc -O2 -I. -I../src -o bench_timer_doltlite ../test/sysbench_timer.c libdoltlite.a -lpthread -lz -lm | |
| make DOLTLITE_PROLLY=0 sqlite3 sqlite3.o | |
| cc -O2 -I. -I../src -o bench_timer_sqlite ../test/sysbench_timer.c sqlite3.o -lpthread -lz -lm | |
| - name: Run benchmark | |
| id: bench | |
| run: | | |
| cd build | |
| # The script enforces the configured individual and average ceilings; | |
| # capture rc separately so results are still posted on a failure. | |
| set +e | |
| bash ../test/${{ matrix.suite.script }} > "${{ matrix.suite.output }}" | |
| bench_rc=$? | |
| set -e | |
| cat "${{ matrix.suite.output }}" | |
| echo "bench_rc=$bench_rc" >> "$GITHUB_OUTPUT" | |
| - name: Comment PR with results | |
| continue-on-error: true | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| // Read from file so the multi-line markdown (and any backticks / | |
| // template-literal-unsafe chars in it) never has to round-trip | |
| // through YAML scalars or JS template-literal parsing. | |
| const fs = require('fs'); | |
| const body = fs.readFileSync('${{ matrix.suite.output }}', 'utf8'); | |
| if (!context.issue.number) { | |
| console.log('No PR context (push event) — skipping comment'); | |
| return; | |
| } | |
| const marker = '${{ matrix.suite.marker }}'; | |
| const comments = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const botComment = comments.data.find(c => c.body.includes(marker)); | |
| if (botComment) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: botComment.id, | |
| body: body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: body, | |
| }); | |
| } | |
| - name: Enforce ceiling | |
| run: | | |
| rc="${{ steps.bench.outputs.bench_rc }}" | |
| if [ "$rc" != "0" ]; then | |
| echo "Benchmark exceeded performance ceiling (rc=$rc)" >&2 | |
| exit "$rc" | |
| fi | |
| vc-perf: | |
| name: version-control-perf | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| env: | |
| VC_PERF_RUNS: 3 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| bash .github/scripts/install-apt-deps.sh tcl-dev build-essential zlib1g-dev | |
| - name: Configure | |
| run: | | |
| mkdir -p build && cd build | |
| TCL_CONFIG=$(find /usr -path '/usr/share/miniconda/*' -prune -o -name tclConfig.sh -print 2>/dev/null | head -1) | |
| if [ -n "$TCL_CONFIG" ]; then | |
| ../configure --with-tcl=$(dirname $TCL_CONFIG) | |
| else | |
| ../configure | |
| fi | |
| - name: Build doltlite | |
| run: | | |
| cd build | |
| make doltlite | |
| - name: Run version-control performance benchmarks | |
| id: bench | |
| run: | | |
| cd build | |
| # Capture rc separately so benchmark output is still posted when | |
| # a ceiling fails. | |
| set +e | |
| bash ../test/vc_perf_ceiling.sh ./doltlite > /tmp/bench_vc_perf.md | |
| bench_rc=$? | |
| set -e | |
| cat /tmp/bench_vc_perf.md | |
| echo "bench_rc=$bench_rc" >> "$GITHUB_OUTPUT" | |
| - name: Comment PR with results | |
| continue-on-error: true | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const body = fs.readFileSync('/tmp/bench_vc_perf.md', 'utf8'); | |
| if (!context.issue.number) { | |
| console.log('No PR context (push event) — skipping comment'); | |
| return; | |
| } | |
| const marker = '<!-- benchmark:vc-perf -->'; | |
| const comments = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const botComment = comments.data.find(c => c.body.includes(marker)); | |
| if (botComment) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: botComment.id, | |
| body: body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: body, | |
| }); | |
| } | |
| - name: Enforce ceiling | |
| run: | | |
| rc="${{ steps.bench.outputs.bench_rc }}" | |
| if [ "$rc" != "0" ]; then | |
| echo "Version-control benchmark exceeded performance ceiling (rc=$rc)" >&2 | |
| exit "$rc" | |
| fi |