name: Benchmark docs # Regenerate the Markdown benchmark tables (README.md, docs/content/performance.md) # and the SVG charts (docs/public/benchmark-*.svg) from a clean CI environment, # then open a pull request with the refreshed numbers. Running on a consistent # runner keeps the committed numbers comparable across refreshes — local # machines vary too much to be the source of truth. on: workflow_dispatch: inputs: runs: description: "Median of N benchmark runs" type: string default: "7" schedule: # Weekly, Monday 06:00 UTC. - cron: "0 6 * * 1" permissions: contents: read env: CARGO_TERM_COLOR: always OX_CONTENT_BENCHMARK_RUNNER: blacksmith-32vcpu-ubuntu-2404 STICKY_CACHE_SCOPE: ${{ github.ref_name }} jobs: refresh: name: Refresh benchmark docs # Highest Blacksmith tier (32 vCPU, whole bare-metal host) — best single-thread # performance and host isolation for stable numbers, and matches the runner used # by benchmark.yml so committed numbers track the PR-benchmark environment. runs-on: blacksmith-32vcpu-ubuntu-2404 permissions: contents: write pull-requests: write steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Setup Vite+ uses: voidzero-dev/setup-vp@2dec1e33f4ab2c6d5bce1b0c4607961bb1a3f7a1 # v1 with: node-version-file: ".node-version" cache: true run-install: true - name: Setup Rust uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable - name: Mount sticky cache uses: ./.github/actions/mount-sticky-cache with: key-prefix: ${{ github.repository }}-benchmark-docs-${{ github.job }}-${{ env.STICKY_CACHE_SCOPE }} cargo: "true" target: target # The render comparison includes `Bun.markdown.html`, available only in # Bun >= 1.3.8. Pin a version that ships the API so the row is always # present (matches .github/workflows/benchmark.yml). - name: Setup Bun uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: bun-version: "1.3.14" - name: Regenerate benchmark docs run: vp run bench:docs env: OX_CONTENT_BENCHMARK_RUNS: ${{ github.event.inputs.runs || '7' }} - name: Create pull request uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 with: commit-message: "docs: refresh benchmark numbers" branch: ci/benchmark-docs-refresh delete-branch: true title: "docs: refresh benchmark numbers" body: | Automated refresh of the Markdown benchmark tables and charts from the Benchmark docs workflow (`blacksmith-32vcpu-ubuntu-2404` runner, Bun 1.3.14 so the `Bun.markdown.html` row is included, median of ${{ github.event.inputs.runs || '7' }} runs). Updated: - `README.md` and `docs/content/performance.md` benchmark tables - `docs/public/benchmark-*.svg` charts Numbers track the runner; the relative ordering between engines is the stable signal. Review the deltas before merging. labels: documentation add-paths: | README.md docs/content/performance.md docs/public/benchmark-parse.svg docs/public/benchmark-render.svg docs/public/benchmark-parse-huge.svg docs/public/benchmark-render-huge.svg