Skip to content

fix(next): prewarm SWC plugin cache before parallel loaders#2538

Merged
NathanColosimo merged 2 commits into
mainfrom
codex/fix-swc-plugin-cache-race
Jun 22, 2026
Merged

fix(next): prewarm SWC plugin cache before parallel loaders#2538
NathanColosimo merged 2 commits into
mainfrom
codex/fix-swc-plugin-cache-race

Conversation

@NathanColosimo

@NathanColosimo NathanColosimo commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Prewarm the Workflow SWC plugin during Next.js build/dev configuration, before Turbopack starts parallel loader workers.
  • Give the prewarm and every loader the same explicit <project>/.swc cache root.
  • Keep next start unchanged by loading the prewarm helper only for build and development phases.
  • Add a real 16-process regression test and enable the existing @workflow/next Vitest suite in Turbo.

Context: #2534 initially failed to build at this preview deployment.

Root cause

SWC's Wasmer plugin cache is not safe when several processes populate the same cold entry concurrently. Turbopack can start multiple Workflow loader subprocesses at once; their first transforms compile the same Workflow WASM plugin and write the same .wasmer-v7 cache file. A process can mmap a partially written artifact and terminate with SIGBUS.

The Next.js loader process exited before reporting an error message is secondary error reporting. The cache publication race is in SWC/Wasmer; Workflow triggers it by loading the same plugin concurrently.

The direct cold-cache reproducer failed:

  • 12/30 trials with 4 concurrent processes
  • 3/3 trials with 25 concurrent processes

Prewarming once in the parent configuration process closes that race without serializing application transforms. Turbopack workers still run in parallel and only read the completed cache artifact.

Implementation

The runtime path is intentionally small and stateless:

  1. During phase-production-build and phase-development-server, dynamically import the prewarm helper.
  2. Run one minimal synchronous transform with the real Workflow plugin and an explicit cache root.
  3. Configure loader transforms with that same cache root.

Any warmup failure fails configuration before workers can observe an incomplete artifact. There is no fallback state or retry branch.

Validation

  • pnpm test --filter @workflow/next: 11/11 tests passed
  • Real regression test: 16 Node subprocesses concurrently read a newly prewarmed cache
  • Original harness against the final helper: 0/30 failures with 4 workers
  • Amplified harness: 0/3 failures with 500 transforms across 25 workers
  • pnpm --filter @workflow/next build: passed
  • Biome: no new findings
  • Vercel example-nextjs-workflow-turbopack preview: passed

Build profile

Five alternating cold/warm pairs were measured for baseline and fixed builds in Linux ARM64 Docker with 4 CPUs, Node 22.18, pnpm 10.20, Next.js 16.2.1, and Turbopack. .next was removed for every run; .swc was additionally removed for cold runs.

Scenario Baseline median Fixed median Delta
Cold cache, complete build 19.872 s 19.340 s -2.68%
Cold cache, Next compile 12.400 s 11.500 s -7.26%
Warm cache, complete build 19.493 s 19.421 s -0.37%
Warm cache, Next compile 11.800 s 11.600 s -1.69%

The standalone prewarm measured 236 ms cold and 14 ms warm at the median. Cold compilation is work a loader already had to perform; moving it before worker startup prevents duplicate concurrent compilation. The conservative conclusion is no measurable build regression—the apparent cold improvement is encouraging but the sample is too small to claim a guaranteed speedup.

The full benchmark used the initial equivalent prewarm implementation. Final review only removed in-process state and unnecessary transform options; it did not add work to the measured path.

Upstream boundary

This is a defensive Workflow fix. SWC should still publish cache artifacts atomically and coordinate writers: swc-project/swc#10065.

Improved Next.js loader-crash reporting would make this class of native failure easier to diagnose, but would not prevent it: vercel/next.js#93926.

@vercel

vercel Bot commented Jun 19, 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 Jun 22, 2026 8:13pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jun 22, 2026 8:13pm
example-workflow Building Building Preview, Comment Jun 22, 2026 8:13pm
workbench-astro-workflow Ready Ready Preview, Comment Jun 22, 2026 8:13pm
workbench-express-workflow Ready Ready Preview, Comment Jun 22, 2026 8:13pm
workbench-fastify-workflow Ready Ready Preview, Comment Jun 22, 2026 8:13pm
workbench-hono-workflow Ready Ready Preview, Comment Jun 22, 2026 8:13pm
workbench-nitro-workflow Ready Ready Preview, Comment Jun 22, 2026 8:13pm
workbench-nuxt-workflow Ready Ready Preview, Comment Jun 22, 2026 8:13pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Jun 22, 2026 8:13pm
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jun 22, 2026 8:13pm
workbench-vite-workflow Ready Ready Preview, Comment Jun 22, 2026 8:13pm
workflow-docs Building Building Preview, Comment, Open in v0 Jun 22, 2026 8:13pm
workflow-swc-playground Ready Ready Preview, Comment Jun 22, 2026 8:13pm
workflow-tarballs Ready Ready Preview, Comment Jun 22, 2026 8:13pm
workflow-web Ready Ready Preview, Comment Jun 22, 2026 8:13pm

@changeset-bot

changeset-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2b46a69

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

This PR includes changesets to release 16 packages
Name Type
@workflow/next Patch
workflow Patch
@workflow/world-testing Patch
@workflow/core Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/web Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/nuxt Patch

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 Jun 19, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1442 0 230 1672
✅ 💻 Local Development 1605 0 219 1824
✅ 📦 Local Production 1605 0 219 1824
✅ 🐘 Local Postgres 1593 0 231 1824
✅ 🪟 Windows 152 0 0 152
✅ 📋 Other 885 0 179 1064
Total 7282 0 1078 8360

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 125 0 27
✅ example 125 0 27
✅ express 125 0 27
✅ fastify 125 0 27
✅ hono 125 0 27
✅ nextjs-turbopack 149 0 3
✅ nextjs-webpack 149 0 3
✅ nitro 125 0 27
✅ nuxt 125 0 27
✅ sveltekit 144 0 8
✅ vite 125 0 27
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 127 0 25
✅ express-stable 127 0 25
✅ fastify-stable 127 0 25
✅ hono-stable 127 0 25
✅ nextjs-turbopack-canary 133 0 19
✅ nextjs-turbopack-stable 152 0 0
✅ nextjs-webpack-canary 133 0 19
✅ nextjs-webpack-stable 152 0 0
✅ nitro-stable 127 0 25
✅ nuxt-stable 127 0 25
✅ sveltekit-stable 146 0 6
✅ vite-stable 127 0 25
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 127 0 25
✅ express-stable 127 0 25
✅ fastify-stable 127 0 25
✅ hono-stable 127 0 25
✅ nextjs-turbopack-canary 133 0 19
✅ nextjs-turbopack-stable 152 0 0
✅ nextjs-webpack-canary 133 0 19
✅ nextjs-webpack-stable 152 0 0
✅ nitro-stable 127 0 25
✅ nuxt-stable 127 0 25
✅ sveltekit-stable 146 0 6
✅ vite-stable 127 0 25
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 126 0 26
✅ express-stable 126 0 26
✅ fastify-stable 126 0 26
✅ hono-stable 126 0 26
✅ nextjs-turbopack-canary 132 0 20
✅ nextjs-turbopack-stable 151 0 1
✅ nextjs-webpack-canary 132 0 20
✅ nextjs-webpack-stable 151 0 1
✅ nitro-stable 126 0 26
✅ nuxt-stable 126 0 26
✅ sveltekit-stable 145 0 7
✅ vite-stable 126 0 26
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 152 0 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 127 0 25
✅ e2e-local-dev-tanstack-start- 127 0 25
✅ e2e-local-postgres-nest-stable 126 0 26
✅ e2e-local-postgres-tanstack-start- 126 0 26
✅ e2e-local-prod-nest-stable 127 0 25
✅ e2e-local-prod-tanstack-start- 127 0 25
✅ e2e-vercel-prod-tanstack-start 125 0 27

📋 View full workflow run

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 0.037s (-10.7% 🟢) 1.005s (~) 0.968s 10 1.00x
💻 Local Next.js (Turbopack) 0.049s (+1.9%) 1.006s (~) 0.957s 10 1.34x
💻 Local Express 0.049s (+19.9% 🔺) 1.006s (~) 0.956s 10 1.35x
🐘 Postgres Next.js (Turbopack) 0.055s (-5.5% 🟢) 1.011s (~) 0.956s 10 1.50x
🐘 Postgres Express 0.065s (+4.5%) 1.012s (~) 0.948s 10 1.76x
🐘 Postgres Nitro 0.073s (+15.3% 🔺) 1.012s (~) 0.939s 10 1.99x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 0.297s (-23.9% 🟢) 2.588s (+2.4%) 2.291s 10 1.00x
▲ Vercel Next.js (Turbopack) 0.318s (-1.7%) 2.494s (-10.6% 🟢) 2.176s 10 1.07x
▲ Vercel Express 0.468s (+17.8% 🔺) 2.581s (+5.9% 🔺) 2.114s 10 1.58x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.065s (-2.2%) 2.005s (~) 0.941s 10 1.00x
💻 Local Express 1.084s (-1.4%) 2.007s (~) 0.923s 10 1.02x
🐘 Postgres Next.js (Turbopack) 1.088s (-1.3%) 2.010s (~) 0.922s 10 1.02x
💻 Local Next.js (Turbopack) 1.091s (~) 2.006s (~) 0.916s 10 1.02x
🐘 Postgres Express 1.093s (-1.0%) 2.009s (~) 0.916s 10 1.03x
🐘 Postgres Nitro 1.097s (-0.6%) 2.010s (~) 0.913s 10 1.03x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 1.412s (-10.6% 🟢) 3.011s (-19.0% 🟢) 1.599s 10 1.00x
▲ Vercel Nitro 1.502s (-2.5%) 2.972s (-15.4% 🟢) 1.470s 10 1.06x
▲ Vercel Express 1.586s (+4.2%) 3.709s (+3.9%) 2.124s 10 1.12x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 10.350s (-1.6%) 11.022s (~) 0.672s 3 1.00x
🐘 Postgres Nitro 10.465s (-0.8%) 11.020s (~) 0.555s 3 1.01x
💻 Local Express 10.468s (~) 11.022s (~) 0.554s 3 1.01x
🐘 Postgres Express 10.475s (-0.6%) 11.018s (~) 0.543s 3 1.01x
🐘 Postgres Next.js (Turbopack) 10.487s (-0.9%) 11.018s (~) 0.531s 3 1.01x
💻 Local Next.js (Turbopack) 10.529s (~) 11.022s (~) 0.494s 3 1.02x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 11.800s (-8.0% 🟢) 14.128s (-7.5% 🟢) 2.328s 3 1.00x
▲ Vercel Express 12.300s (-6.1% 🟢) 14.613s (-3.9%) 2.313s 3 1.04x
▲ Vercel Next.js (Turbopack) 12.683s (-3.8%) 14.339s (-6.7% 🟢) 1.657s 3 1.07x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 13.388s (-2.1%) 14.026s (~) 0.638s 5 1.00x
🐘 Postgres Nitro 13.603s (-2.2%) 14.017s (~) 0.413s 5 1.02x
🐘 Postgres Express 13.607s (-1.3%) 14.020s (~) 0.413s 5 1.02x
💻 Local Next.js (Turbopack) 13.625s (-0.6%) 14.027s (~) 0.402s 5 1.02x
💻 Local Express 13.669s (-2.3%) 14.028s (-1.4%) 0.359s 5 1.02x
🐘 Postgres Next.js (Turbopack) 13.708s (-1.5%) 14.021s (~) 0.313s 5 1.02x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 16.876s (-21.5% 🟢) 18.945s (-19.4% 🟢) 2.069s 4 1.00x
▲ Vercel Express 17.168s (-14.8% 🟢) 19.128s (-14.7% 🟢) 1.960s 4 1.02x
▲ Vercel Next.js (Turbopack) 19.230s (-3.6%) 21.927s (-1.3%) 2.697s 3 1.14x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 11.801s (-4.0%) 12.146s (-6.8% 🟢) 0.346s 8 1.00x
🐘 Postgres Nitro 12.133s (-2.2%) 13.018s (~) 0.884s 7 1.03x
🐘 Postgres Next.js (Turbopack) 12.168s (-2.9%) 13.014s (~) 0.846s 7 1.03x
💻 Local Express 12.205s (-3.1%) 13.026s (~) 0.821s 7 1.03x
💻 Local Next.js (Turbopack) 12.263s (-1.6%) 13.026s (~) 0.763s 7 1.04x
🐘 Postgres Express 12.269s (-1.5%) 13.020s (~) 0.751s 7 1.04x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 22.694s (-8.2% 🟢) 25.508s (-4.5%) 2.814s 4 1.00x
▲ Vercel Express 22.834s (-0.8%) 25.715s (+2.2%) 2.881s 4 1.01x
▲ Vercel Next.js (Turbopack) 23.423s (-6.9% 🟢) 25.352s (-7.6% 🟢) 1.929s 4 1.03x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 1.176s (+1.5%) 2.008s (~) 0.832s 15 1.00x
🐘 Postgres Express 1.187s (-0.7%) 2.007s (~) 0.820s 15 1.01x
🐘 Postgres Nitro 1.188s (~) 2.007s (~) 0.819s 15 1.01x
💻 Local Nitro 1.315s (+9.3% 🔺) 2.006s (~) 0.691s 15 1.12x
💻 Local Express 1.446s (+17.5% 🔺) 2.007s (~) 0.561s 15 1.23x
💻 Local Next.js (Turbopack) 1.469s (+6.8% 🔺) 2.007s (~) 0.538s 15 1.25x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.433s (-8.1% 🟢) 4.146s (-6.9% 🟢) 1.713s 8 1.00x
▲ Vercel Express 2.567s (-4.7%) 4.473s (~) 1.905s 7 1.06x
▲ Vercel Next.js (Turbopack) 2.942s (+13.5% 🔺) 4.546s (+2.7%) 1.604s 7 1.21x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 1.300s (+3.9%) 3.009s (+50.0% 🔺) 1.710s 10 1.00x
🐘 Postgres Nitro 1.305s (+2.9%) 2.392s (+19.2% 🔺) 1.087s 13 1.00x
🐘 Postgres Express 1.327s (+1.5%) 2.470s (+19.1% 🔺) 1.143s 13 1.02x
💻 Local Nitro 1.961s (-2.7%) 2.507s (~) 0.546s 12 1.51x
💻 Local Express 2.192s (+7.7% 🔺) 2.918s (+16.4% 🔺) 0.726s 11 1.69x
💻 Local Next.js (Turbopack) 2.602s (+11.0% 🔺) 3.008s (+3.1%) 0.406s 10 2.00x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.879s (+15.7% 🔺) 4.696s (+15.7% 🔺) 1.817s 7 1.00x
▲ Vercel Next.js (Turbopack) 3.984s (+25.1% 🔺) 6.038s (+17.8% 🔺) 2.054s 6 1.38x
▲ Vercel Express 4.088s (+44.2% 🔺) 6.125s (+33.4% 🔺) 2.037s 5 1.42x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.555s (+7.3% 🔺) 3.885s (+5.6% 🔺) 2.330s 8 1.00x
🐘 Postgres Express 1.614s (-2.6%) 4.138s (+10.0% 🔺) 2.524s 8 1.04x
🐘 Postgres Next.js (Turbopack) 1.895s (+27.8% 🔺) 5.679s (+46.1% 🔺) 3.784s 6 1.22x
💻 Local Nitro 4.861s (+8.5% 🔺) 5.512s (+10.0% 🔺) 0.651s 6 3.12x
💻 Local Express 6.023s (+4.3%) 6.414s (~) 0.392s 5 3.87x
💻 Local Next.js (Turbopack) 6.426s (-3.9%) 7.016s (-5.4% 🟢) 0.590s 5 4.13x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 4.378s (+42.5% 🔺) 6.819s (+38.3% 🔺) 2.441s 5 1.00x
▲ Vercel Next.js (Turbopack) 4.846s (+38.4% 🔺) 6.724s (+23.8% 🔺) 1.877s 5 1.11x
▲ Vercel Nitro 5.253s (+70.9% 🔺) 7.709s (+56.9% 🔺) 2.456s 4 1.20x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.177s (-1.8%) 2.008s (~) 0.830s 15 1.00x
🐘 Postgres Next.js (Turbopack) 1.179s (~) 2.008s (~) 0.829s 15 1.00x
🐘 Postgres Express 1.186s (-0.8%) 2.007s (~) 0.822s 15 1.01x
💻 Local Nitro 1.343s (+9.2% 🔺) 2.005s (~) 0.663s 15 1.14x
💻 Local Express 1.441s (+17.2% 🔺) 2.007s (~) 0.565s 15 1.22x
💻 Local Next.js (Turbopack) 1.461s (+8.2% 🔺) 2.007s (~) 0.546s 15 1.24x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.674s (+32.1% 🔺) 4.370s (+11.9% 🔺) 1.696s 7 1.00x
▲ Vercel Nitro 2.712s (+25.1% 🔺) 4.467s (+15.2% 🔺) 1.755s 7 1.01x
▲ Vercel Next.js (Turbopack) 2.767s (+29.3% 🔺) 4.261s (+5.0% 🔺) 1.494s 8 1.03x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 1.276s (+1.0%) 3.008s (+45.0% 🔺) 1.732s 10 1.00x
🐘 Postgres Nitro 1.323s (+3.7%) 2.075s (+3.4%) 0.753s 15 1.04x
🐘 Postgres Express 1.337s (+3.3%) 2.316s (+15.4% 🔺) 0.979s 13 1.05x
💻 Local Nitro 2.242s (+11.5% 🔺) 2.916s (+26.0% 🔺) 0.674s 11 1.76x
💻 Local Next.js (Turbopack) 2.325s (-3.9%) 3.110s (+6.6% 🔺) 0.785s 10 1.82x
💻 Local Express 2.615s (+28.3% 🔺) 3.108s (+13.6% 🔺) 0.493s 10 2.05x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.118s (+20.8% 🔺) 5.414s (+24.5% 🔺) 2.296s 6 1.00x
▲ Vercel Nitro 3.445s (+25.6% 🔺) 5.454s (+27.0% 🔺) 2.009s 6 1.11x
▲ Vercel Next.js (Turbopack) 4.840s (+81.7% 🔺) 6.771s (+62.7% 🔺) 1.932s 5 1.55x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.585s (+8.8% 🔺) 4.134s (+9.9% 🔺) 2.549s 8 1.00x
🐘 Postgres Express 1.650s (+15.3% 🔺) 4.141s (+10.1% 🔺) 2.491s 8 1.04x
🐘 Postgres Next.js (Turbopack) 3.055s (+108.0% 🔺) 5.847s (+50.5% 🔺) 2.792s 6 1.93x
💻 Local Nitro 5.418s (+9.6% 🔺) 6.013s (+9.0% 🔺) 0.595s 5 3.42x
💻 Local Next.js (Turbopack) 5.945s (-12.4% 🟢) 6.617s (-12.0% 🟢) 0.672s 5 3.75x
💻 Local Express 6.537s (+9.6% 🔺) 7.015s (+2.9%) 0.478s 5 4.13x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 4.080s (-4.1%) 6.203s (+1.8%) 2.123s 5 1.00x
▲ Vercel Nitro 4.523s (+2.7%) 7.070s (+7.6% 🔺) 2.546s 5 1.11x
▲ Vercel Next.js (Turbopack) 4.655s (+40.8% 🔺) 7.119s (+35.4% 🔺) 2.464s 5 1.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 0.493s (-13.5% 🟢) 1.021s (~) 0.527s 59 1.00x
🐘 Postgres Next.js (Turbopack) 0.524s (-7.3% 🟢) 1.006s (-1.7%) 0.482s 60 1.06x
🐘 Postgres Nitro 0.554s (-1.4%) 1.041s (+1.7%) 0.487s 58 1.12x
🐘 Postgres Express 0.564s (-2.1%) 1.006s (-1.7%) 0.442s 60 1.14x
💻 Local Express 0.588s (-3.7%) 1.005s (~) 0.417s 60 1.19x
💻 Local Next.js (Turbopack) 0.601s (-1.7%) 1.005s (-1.6%) 0.404s 60 1.22x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.246s (-5.4% 🟢) 5.177s (-4.6%) 1.932s 12 1.00x
▲ Vercel Nitro 3.697s (+22.7% 🔺) 5.404s (+7.1% 🔺) 1.707s 12 1.14x
▲ Vercel Next.js (Turbopack) 4.303s (+4.1%) 6.207s (-0.6%) 1.904s 10 1.33x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.259s (-1.2%) 2.030s (+1.2%) 0.772s 45 1.00x
🐘 Postgres Next.js (Turbopack) 1.318s (+3.4%) 2.053s (+2.3%) 0.735s 44 1.05x
🐘 Postgres Express 1.328s (~) 2.008s (~) 0.680s 45 1.06x
💻 Local Nitro 1.344s (-2.8%) 2.005s (~) 0.661s 45 1.07x
💻 Local Express 1.472s (-5.6% 🟢) 2.006s (-1.1%) 0.534s 45 1.17x
💻 Local Next.js (Turbopack) 1.606s (+8.9% 🔺) 2.075s (+3.4%) 0.469s 44 1.28x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 8.610s (~) 10.906s (+4.6%) 2.296s 9 1.00x
▲ Vercel Nitro 8.901s (+16.6% 🔺) 11.038s (+16.2% 🔺) 2.137s 9 1.03x
▲ Vercel Next.js (Turbopack) 10.677s (+30.4% 🔺) 12.655s (+26.5% 🔺) 1.978s 8 1.24x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 2.539s (~) 3.009s (~) 0.470s 40 1.00x
🐘 Postgres Nitro 2.564s (-3.4%) 3.137s (~) 0.573s 39 1.01x
🐘 Postgres Express 2.679s (+1.6%) 3.059s (~) 0.380s 40 1.06x
💻 Local Nitro 2.791s (-6.9% 🟢) 3.191s (-7.1% 🟢) 0.400s 38 1.10x
💻 Local Express 3.213s (-1.2%) 4.009s (~) 0.797s 30 1.27x
💻 Local Next.js (Turbopack) 3.326s (+3.8%) 4.010s (+0.8%) 0.684s 30 1.31x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 17.257s (+3.4%) 19.827s (+4.2%) 2.570s 7 1.00x
▲ Vercel Express 17.395s (+15.7% 🔺) 20.023s (+16.3% 🔺) 2.628s 6 1.01x
▲ Vercel Next.js (Turbopack) 20.943s (+29.3% 🔺) 22.963s (+24.7% 🔺) 2.020s 6 1.21x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 0.160s (-10.6% 🟢) 1.006s (~) 0.846s 60 1.00x
🐘 Postgres Nitro 0.208s (-1.9%) 1.006s (~) 0.798s 60 1.30x
🐘 Postgres Express 0.219s (~) 1.006s (~) 0.787s 60 1.37x
💻 Local Nitro 0.396s (+17.4% 🔺) 1.004s (~) 0.608s 60 2.47x
💻 Local Express 0.501s (+46.7% 🔺) 1.022s (+1.7%) 0.521s 59 3.13x
💻 Local Next.js (Turbopack) 0.628s (+3.6%) 1.006s (~) 0.378s 60 3.92x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 1.568s (+14.7% 🔺) 3.566s (+14.3% 🔺) 1.998s 17 1.00x
▲ Vercel Express 1.579s (+24.8% 🔺) 3.406s (+15.2% 🔺) 1.827s 18 1.01x
▲ Vercel Next.js (Turbopack) 1.684s (+27.9% 🔺) 3.471s (+16.7% 🔺) 1.787s 18 1.07x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 0.260s (-2.8%) 1.006s (~) 0.746s 90 1.00x
🐘 Postgres Nitro 0.309s (-4.2%) 1.007s (~) 0.697s 90 1.19x
🐘 Postgres Express 0.323s (+0.7%) 1.017s (+1.1%) 0.694s 89 1.24x
💻 Local Nitro 1.738s (-14.2% 🟢) 2.202s (-10.8% 🟢) 0.464s 41 6.67x
💻 Local Express 2.140s (+9.4% 🔺) 2.736s (+10.8% 🔺) 0.596s 33 8.21x
💻 Local Next.js (Turbopack) 2.684s (+0.7%) 3.182s (+3.5%) 0.498s 29 10.30x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.253s (+32.8% 🔺) 4.203s (+18.9% 🔺) 1.950s 22 1.00x
▲ Vercel Nitro 2.343s (+38.2% 🔺) 4.319s (+20.3% 🔺) 1.976s 22 1.04x
▲ Vercel Next.js (Turbopack) 2.358s (+5.1% 🔺) 4.115s (-1.7%) 1.757s 23 1.05x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 0.468s (-3.0%) 2.985s (-1.6%) 2.517s 41 1.00x
🐘 Postgres Nitro 0.515s (-1.7%) 1.059s (+0.9%) 0.544s 114 1.10x
🐘 Postgres Express 0.522s (+6.0% 🔺) 1.041s (+2.6%) 0.518s 116 1.12x
💻 Local Nitro 8.422s (-10.0% 🟢) 9.253s (-8.5% 🟢) 0.831s 13 18.01x
💻 Local Express 9.963s (+1.8%) 11.027s (+3.9%) 1.063s 11 21.31x
💻 Local Next.js (Turbopack) 10.216s (+1.5%) 11.121s (~) 0.905s 11 21.85x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.983s (+35.4% 🔺) 5.416s (+31.8% 🔺) 2.433s 23 1.00x
▲ Vercel Express 3.821s (+57.6% 🔺) 6.076s (+38.9% 🔺) 2.255s 20 1.28x
▲ Vercel Next.js (Turbopack) 4.826s (+36.2% 🔺) 6.725s (+24.1% 🔺) 1.899s 18 1.62x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.123s (-2.3%) 2.003s (~) 0.008s (-10.9% 🟢) 2.014s (~) 0.891s 10 1.00x
💻 Local Next.js (Turbopack) 1.144s (-0.8%) 1.969s (-1.7%) 0.012s (-2.4%) 2.020s (~) 0.876s 10 1.02x
🐘 Postgres Express 1.152s (-2.2%) 1.995s (~) 0.001s (-14.3% 🟢) 2.009s (~) 0.857s 10 1.03x
🐘 Postgres Nitro 1.154s (-1.3%) 1.998s (~) 0.001s (-36.8% 🟢) 2.010s (~) 0.856s 10 1.03x
🐘 Postgres Next.js (Turbopack) 1.154s (-1.4%) 2.001s (~) 0.001s (-16.7% 🟢) 2.011s (~) 0.857s 10 1.03x
💻 Local Express 1.158s (-1.4%) 2.005s (~) 0.012s (~) 2.020s (~) 0.862s 10 1.03x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.003s (-11.3% 🟢) 3.385s (-0.7%) 2.093s (-22.7% 🟢) 6.084s (-10.7% 🟢) 4.081s 10 1.00x
▲ Vercel Nitro 2.145s (~) 3.523s (+3.3%) 2.140s (+34.4% 🔺) 6.256s (+12.1% 🔺) 4.111s 10 1.07x
▲ Vercel Next.js (Turbopack) 2.667s (+26.4% 🔺) 3.889s (+15.0% 🔺) 2.607s (+57.1% 🔺) 7.089s (+28.0% 🔺) 4.422s 10 1.33x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.426s (-9.7% 🟢) 2.009s (~) 0.011s (-6.1% 🟢) 2.023s (~) 0.598s 30 1.00x
🐘 Postgres Nitro 1.527s (-7.0% 🟢) 2.002s (-1.8%) 0.005s (+5.4% 🔺) 2.025s (-1.6%) 0.498s 30 1.07x
💻 Local Express 1.564s (-1.3%) 2.011s (~) 0.012s (-1.3%) 2.026s (~) 0.462s 30 1.10x
💻 Local Next.js (Turbopack) 1.572s (-2.8%) 1.971s (-1.9%) 0.013s (+1.8%) 2.026s (~) 0.454s 30 1.10x
🐘 Postgres Express 1.594s (+0.5%) 2.035s (+1.5%) 0.005s (+2.7%) 2.059s (+1.6%) 0.464s 30 1.12x
🐘 Postgres Next.js (Turbopack) 1.605s (~) 2.010s (~) 0.005s (-5.4% 🟢) 2.025s (~) 0.419s 30 1.13x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 6.110s (+6.8% 🔺) 7.647s (+0.9%) 0.360s (+16.1% 🔺) 8.590s (+2.0%) 2.481s 7 1.00x
▲ Vercel Express 6.250s (+1.9%) 7.904s (+0.8%) 0.294s (+3.7%) 8.805s (+1.5%) 2.555s 7 1.02x
▲ Vercel Next.js (Turbopack) 7.249s (+22.0% 🔺) 8.730s (+14.9% 🔺) 0.760s (+130.3% 🔺) 10.052s (+18.8% 🔺) 2.804s 7 1.19x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.766s (~) 1.028s (-6.8% 🟢) 0.000s (-100.0% 🟢) 1.043s (-6.7% 🟢) 0.277s 58 1.00x
🐘 Postgres Express 0.816s (+6.9% 🔺) 1.080s (+1.5%) 0.000s (NaN%) 1.125s (+4.3%) 0.309s 55 1.07x
🐘 Postgres Next.js (Turbopack) 0.979s (+28.6% 🔺) 1.419s (+30.4% 🔺) 0.000s (-100.0% 🟢) 1.428s (+30.3% 🔺) 0.449s 43 1.28x
💻 Local Nitro 1.041s (-23.7% 🟢) 1.704s (-15.3% 🟢) 0.000s (-51.4% 🟢) 1.707s (-15.3% 🟢) 0.665s 36 1.36x
💻 Local Express 1.231s (-6.9% 🟢) 1.982s (-1.5%) 0.001s (+58.4% 🔺) 1.984s (-1.5%) 0.754s 31 1.61x
💻 Local Next.js (Turbopack) 1.341s (-7.4% 🟢) 1.981s (-1.5%) 0.000s (+55.6% 🔺) 2.017s (~) 0.676s 30 1.75x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.543s (+4.9%) 4.915s (-2.6%) 0.000s (-100.0% 🟢) 5.589s (~) 2.046s 11 1.00x
▲ Vercel Nitro 3.637s (-23.5% 🟢) 5.255s (-20.3% 🟢) 0.000s (NaN%) 5.841s (-18.0% 🟢) 2.203s 11 1.03x
▲ Vercel Next.js (Turbopack) 5.613s (+32.7% 🔺) 7.182s (+15.6% 🔺) 0.000s (-100.0% 🟢) 7.772s (+14.1% 🔺) 2.159s 9 1.58x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

fan-out fan-in 10 streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.542s (-6.8% 🟢) 2.135s (-3.6%) 0.000s (-100.0% 🟢) 2.178s (-2.3%) 0.636s 28 1.00x
🐘 Postgres Express 1.586s (+3.7%) 2.174s (+3.5%) 0.000s (-100.0% 🟢) 2.206s (+2.5%) 0.619s 28 1.03x
🐘 Postgres Next.js (Turbopack) 2.291s (+20.0% 🔺) 2.908s (+14.3% 🔺) 0.000s (NaN%) 2.946s (+15.5% 🔺) 0.655s 21 1.49x
💻 Local Nitro 2.868s (-18.1% 🟢) 3.412s (-13.9% 🟢) 0.001s (-1.2%) 3.418s (-14.0% 🟢) 0.550s 18 1.86x
💻 Local Next.js (Turbopack) 3.613s (-12.3% 🟢) 4.259s (-7.4% 🟢) 0.001s (-43.0% 🟢) 4.300s (-6.7% 🟢) 0.687s 15 2.34x
💻 Local Express 3.829s (+5.1% 🔺) 4.384s (+3.7%) 0.001s (-14.3% 🟢) 4.390s (+3.7%) 0.561s 14 2.48x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 5.490s (-3.5%) 7.079s (-0.9%) 0.000s (~) 7.680s (~) 2.190s 8 1.00x
▲ Vercel Express 5.897s (-28.6% 🟢) 7.241s (-26.7% 🟢) 0.000s (-100.0% 🟢) 7.810s (-25.2% 🟢) 1.913s 8 1.07x
▲ Vercel Next.js (Turbopack) 8.117s (+53.3% 🔺) 9.310s (+37.2% 🔺) 0.000s (NaN%) 9.825s (+34.2% 🔺) 1.709s 7 1.48x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Nitro 21/21
🐘 Postgres Next.js (Turbopack) 10/21
▲ Vercel Nitro 11/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 16/21
Next.js (Turbopack) 🐘 Postgres 17/21
Nitro 🐘 Postgres 13/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run

@VaguelySerious VaguelySerious left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

AI pre-review

Comment thread packages/next/src/index.test.ts
Comment thread packages/next/src/index.ts Outdated
Comment thread packages/next/src/swc-plugin-cache.ts
Comment thread packages/next/src/swc-plugin-cache.integration.test.ts
…cache-race

# Conflicts:
#	packages/next/src/index.test.ts
#	packages/next/src/index.ts
@VaguelySerious

Copy link
Copy Markdown
Member

Good to merge if/once all tests pass

@NathanColosimo NathanColosimo marked this pull request as ready for review June 22, 2026 22:27
@NathanColosimo NathanColosimo requested review from a team and ijjk as code owners June 22, 2026 22:27
@NathanColosimo NathanColosimo merged commit 22b2728 into main Jun 22, 2026
196 of 200 checks passed
@NathanColosimo NathanColosimo deleted the codex/fix-swc-plugin-cache-race branch June 22, 2026 22:27
github-actions Bot added a commit that referenced this pull request Jun 22, 2026
Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2576. Merge conflicts were resolved by AI — please review carefully. (backport job run)

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