Skip to content

[ci] Benchmark comment: show avg-latency deltas vs main#2842

Merged
VaguelySerious merged 2 commits into
mainfrom
peter/benchmark-baseline-compare
Jul 8, 2026
Merged

[ci] Benchmark comment: show avg-latency deltas vs main#2842
VaguelySerious merged 2 commits into
mainfrom
peter/benchmark-baseline-compare

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Follow-up to #2820. The benchmark PR comment now shows how average latencies compare to main.

How it works

  • push: main trigger: pushes to main run the benchmark suite against the production deployment, purely to produce bench-results-* artifacts (the comment jobs are gated to pull_request and skip on push).
  • Baseline download: the PR comment job downloads the bench-results-* artifacts from the most recent successful run of this workflow on main (via dawidd6/action-download-artifact, same mechanism the pre-overhaul benchmarks used) and passes them to the renderer via --baseline-dir.
  • Rendering: each Avg cell gets a percentage delta vs the matching baseline row (keyed by backend/app/metric/scenario), e.g. 1035 (+5.6%); (±0%) under 0.5%. Rows without a matching baseline row render unchanged. A footer note explains the comparison.
  • History: the baseline average is embedded per-row in the comment's history data, so collapsed history entries keep showing the delta they were originally compared against, even after re-renders.

Deltas apply only to averages, per the percentile 🟢/🔴 target marks already covering the tail latencies.

Notes

  • Missing baseline (e.g. no successful main run yet, artifact expired) degrades gracefully: no deltas, no footer note.
  • PR runs measure a preview deployment while the main baseline is production — same project and code path, but keep that in mind for small deltas.

Pushes to main now run the benchmarks against the production deployment
and upload their results as artifacts. PR comment rendering downloads
the most recent main baseline and annotates each Avg cell with the
percentage change (e.g. "1035 (+5.6%)"), with a footer note explaining
the comparison. The baseline average is embedded in the comment's
history data so collapsed history entries keep the delta they were
originally compared against.
@VaguelySerious VaguelySerious requested review from a team and ijjk as code owners July 8, 2026 23:07
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Jul 8, 2026 11:33pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jul 8, 2026 11:33pm
example-workflow Ready Ready Preview, Comment Jul 8, 2026 11:33pm
workbench-astro-workflow Ready Ready Preview, Comment Jul 8, 2026 11:33pm
workbench-express-workflow Ready Ready Preview, Comment Jul 8, 2026 11:33pm
workbench-fastify-workflow Ready Ready Preview, Comment Jul 8, 2026 11:33pm
workbench-hono-workflow Ready Ready Preview, Comment Jul 8, 2026 11:33pm
workbench-nitro-workflow Ready Ready Preview, Comment Jul 8, 2026 11:33pm
workbench-nuxt-workflow Ready Ready Preview, Comment Jul 8, 2026 11:33pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Jul 8, 2026 11:33pm
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jul 8, 2026 11:33pm
workbench-vite-workflow Ready Ready Preview, Comment Jul 8, 2026 11:33pm
workflow-docs Ready Ready Preview, Comment, Open in v0 Jul 8, 2026 11:33pm
workflow-swc-playground Ready Ready Preview, Comment Jul 8, 2026 11:33pm
workflow-tarballs Ready Ready Preview, Comment Jul 8, 2026 11:33pm
workflow-web Ready Ready Preview, Comment Jul 8, 2026 11:33pm

@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9d64dd6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit 9d64dd6 · Wed, 08 Jul 2026 23:48:27 GMT · run logs

Backend: vercel · app: nextjs-turbopack

Metric Scenario Avg (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS stream 1171 1632 🔴 1716 🔴 1860 🔴 30
TTFS hook + stream 1484 1969 🔴 2099 🔴 2134 🔴 30
STSO 1020 steps (1-20) 259 289 🔴 341 🔴 367 🔴 19
STSO 1020 steps (101-120) 425 456 🔴 516 🔴 722 🔴 19
STSO 1020 steps (1001-1020) 1002 922 🔴 1164 🔴 3594 🔴 19
WO stream 1171 1632 1716 1860 30
WO hook + stream 1484 1969 2099 2134 30
SL stream 4475 5699 🔴 5807 🔴 6087 🔴 30
SL hook + stream 4929 5572 🔴 5618 🔴 5900 🔴 30
📜 Previous results (1)

e9ebdc3

Wed, 08 Jul 2026 23:26:06 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Avg (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS stream 1394 1715 🔴 1790 🔴 3297 🔴 30
TTFS hook + stream 1560 1950 🔴 2005 🔴 2124 🔴 30
STSO 1020 steps (1-20) 324 324 🔴 489 🔴 1122 🔴 19
STSO 1020 steps (101-120) 405 444 🔴 477 🔴 532 🔴 19
STSO 1020 steps (1001-1020) 856 891 🔴 927 🔴 945 🔴 19
WO stream 1394 1715 1790 3297 30
WO hook + stream 1560 1950 2005 2124 30
SL stream 4794 5500 🔴 5801 🔴 5969 🔴 30
SL hook + stream 4946 5572 🔴 5785 🔴 6182 🔴 30

Metrics — TTFS: time to first step body execution · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (time outside step bodies, client start → last step body exit) · SL: stream latency (first chunk write → visible to the reader)

Scenarios — stream: one step that streams chunks back to the client; no hooks, so the run stays in turbo mode · hook + stream: registers a hook before the same streaming step, which exits turbo mode · 1020 steps: 1020 trivial sequential steps; STSO is measured between consecutive steps in the given step ranges

🟢/🔴 mark percentiles within/above target. Targets (p75/p90/p99, ms) — TTFS 200/300/600 · SL 50/60/125 · STSO (1-20) 20/30/60 · STSO (101-120) 30/45/90 · STSO (1001-1020) 40/60/120

TTFS/WO compare client vs deployment clocks and SL compares the step runner’s clock vs the client’s (NTP-synced in CI). WO ends at the last step body exit, the closest observable proxy for the final step-completion request.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1453 0 230 1683
✅ 💻 Local Development 1617 0 219 1836
✅ 📦 Local Production 1617 0 219 1836
✅ 🐘 Local Postgres 1617 0 219 1836
✅ 🪟 Windows 153 0 0 153
✅ 📋 Other 894 0 177 1071
Total 7351 0 1064 8415

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 126 0 27
✅ example 126 0 27
✅ express 126 0 27
✅ fastify 126 0 27
✅ hono 126 0 27
✅ nextjs-turbopack 150 0 3
✅ nextjs-webpack 150 0 3
✅ nitro 126 0 27
✅ nuxt 126 0 27
✅ sveltekit 145 0 8
✅ vite 126 0 27
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 153 0 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 128 0 25
✅ e2e-local-dev-tanstack-start- 128 0 25
✅ e2e-local-postgres-nest-stable 128 0 25
✅ e2e-local-postgres-tanstack-start- 128 0 25
✅ e2e-local-prod-nest-stable 128 0 25
✅ e2e-local-prod-tanstack-start- 128 0 25
✅ e2e-vercel-prod-tanstack-start 126 0 27

📋 View full workflow run

Comment thread .github/workflows/benchmarks.yml Outdated
# successful run of this workflow on main.
- name: Download baseline results from main
continue-on-error: true
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flagged as a potential supply chain problem 🤔

Socket flagged dawidd6/action-download-artifact (supply-chain score 51).
gh run list/download is first-party and lets us filter baseline runs to
push/workflow_dispatch events, which fork PR runs can never produce —
closing the artifact-poisoning hole where a fork branch named "main"
could upload a crafted bench-results artifact.
@VaguelySerious VaguelySerious enabled auto-merge (squash) July 8, 2026 23:34
@VaguelySerious VaguelySerious merged commit 8977666 into main Jul 8, 2026
101 checks passed
@VaguelySerious VaguelySerious deleted the peter/benchmark-baseline-compare branch July 8, 2026 23:47
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

No backport to stable for 8977666 (AI decision).

This commit is a follow-up to the benchmark-comment overhaul (#2820) and edits .github/scripts/render-benchmark-comment.mjs/.test.js, which do not exist on stable, plus a benchmarks.yml that on stable is a substantially different older version lacking this rendering pipeline. It builds directly on main-only CI infrastructure, so it cannot be cleanly backported.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

897766647956ef2ad512282881101b90efb18397

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants