Skip to content

perf(core): precompile workflow vm.Script at module init - #2524

Open
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init
Open

perf(core): precompile workflow vm.Script at module init#2524
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init

Conversation

@TooTallNate

Copy link
Copy Markdown
Member

Summary

  • Precompile the workflow bundle's vm.Script at module-init time (when workflowEntrypoint is constructed) instead of lazily on the first queue delivery's replay, so the first replay is a cache hit rather than paying the bundle parse/compile on the critical path.
  • workflowEntrypoint gains an optional workflowFilenames option; the builders inline the deduplicated, sorted set of workflow source filenames into generated routes so the precompiled Script matches exactly what runWorkflow compiles under (parseWorkflowName(name)?.moduleSpecifier || name).
  • When no filenames are provided, the bundle is still precompiled once under a representative filename to pay the bulk top-level parse early.

Details

  • packages/core/src/vm/script-cache.ts: add precompileWorkflowScripts() (swallows compile errors so module init never breaks) and an isWorkflowScriptCached() test inspector.
  • packages/core/src/runtime.ts: workflowEntrypoint(workflowCode, { namespace?, workflowFilenames? }) warms the compiled-bundle cache at construction time.
  • packages/builders: getWorkflowFilenamesFromManifest() derives the per-file source filenames from the manifest's workflowIds; wired into all generated-route sites (base-builder workflow-only / combined / combined-watch, builder-deferred watch / production) via createWorkflowEntrypointOptionsCode({ workflowFilenames }).

Verified end-to-end against the example workbench: the generated flow route emits workflowEntrypoint(workflowCode, { workflowFilenames: [...] }) with the deduplicated, sorted filenames.

Testing

  • New unit tests: precompileWorkflowScripts (cache warming, identical-to-lazy Script, empty list, swallows syntax errors), createWorkflowEntrypointOptionsCode (filenames dedup/sort/combine), getWorkflowFilenamesFromManifest, and a workflowEntrypoint module-init precompile assertion.
  • @workflow/core and @workflow/builders build clean; affected test files pass.

Changeset

  • @workflow/core: minor (new workflowFilenames option + module-init precompile)
  • @workflow/builders, @workflow/next: patch (route wiring)

Compile the workflow bundle's `vm.Script` for each known workflow source
filename when `workflowEntrypoint` is constructed (module-init time),
rather than lazily on the first queue delivery's replay. Builders inline
the deduplicated, sorted set of workflow filenames into generated routes
via the new `workflowFilenames` entrypoint option, so the first replay is
a cache hit instead of paying the bundle parse/compile on the critical
path.
@TooTallNate
TooTallNate requested review from a team and ijjk as code ownersJune 18, 2026 21:36
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1ffc078

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

This PR includes changesets to release 16 packages
NameType
@workflow/buildersPatch
@workflow/nextPatch
@workflow/coreMinor
@workflow/astroPatch
@workflow/cliPatch
@workflow/nestPatch
@workflow/nitroPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/vitestPatch
workflowMinor
@workflow/web-sharedPatch
@workflow/webPatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production144022301672
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total8190210809272

❌ Failed Tests

▲ Vercel Production (2 failed)

astro (1 failed):

  • distributedAbortController - manual abort triggers signal | wrun_01KVEBJBCKBY07V9DFPPPE04VN | 🔍 observability

nextjs-turbopack (1 failed):

  • cancelRun via CLI - cancelling a running workflow | wrun_01KVEBB1EZ7BG88HYXXJCCJTXY | 🔍 observability

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro124127
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
❌ nextjs-turbopack14813
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.042s (-4.1%)1.006s (~)0.965s101.00x
💻 LocalNitro0.042s (+2.7%)1.005s (~)0.964s101.00x
💻 LocalNext.js (Turbopack)0.045s (-31.7% 🟢)1.005s (~)0.960s101.08x
🐘 PostgresExpress0.059s (-18.9% 🟢)1.012s (~)0.953s101.42x
🐘 PostgresNext.js (Turbopack)0.065s (-7.4% 🟢)1.012s (~)0.947s101.56x
🐘 PostgresNitro0.065s (+3.7%)1.013s (~)0.947s101.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.451s (+19.6% 🔺)2.595s (+13.1% 🔺)2.144s101.00x
▲ VercelNext.js (Turbopack)0.478s (+64.4% 🔺)2.473s (+30.7% 🔺)1.994s101.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.092s (+0.6%)2.005s (~)0.914s101.00x
💻 LocalExpress1.093s (-0.8%)2.006s (~)0.914s101.00x
🐘 PostgresNitro1.097s (-2.1%)2.008s (~)0.911s101.00x
🐘 PostgresExpress1.102s (~)2.010s (~)0.907s101.01x
💻 LocalNext.js (Turbopack)1.108s (-3.5%)2.006s (~)0.897s101.01x
🐘 PostgresNext.js (Turbopack)1.135s (-0.5%)2.009s (~)0.874s101.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.703s (-12.0% 🟢)3.912s (+6.4% 🔺)2.209s101.00x
▲ VercelNext.js (Turbopack)2.352s (+33.3% 🔺)4.394s (+18.4% 🔺)2.042s101.38x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.497s (~)11.016s (~)0.519s31.00x
🐘 PostgresNitro10.525s (~)11.018s (~)0.492s31.00x
💻 LocalNitro10.527s (~)11.023s (~)0.496s31.00x
💻 LocalExpress10.540s (~)11.023s (~)0.483s31.00x
💻 LocalNext.js (Turbopack)10.606s (-1.8%)11.021s (~)0.415s31.01x
🐘 PostgresNext.js (Turbopack)10.796s (-0.6%)11.018s (~)0.222s31.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)14.860s (+3.8%)16.723s (+2.6%)1.863s21.00x
▲ VercelExpress15.777s (-12.7% 🟢)17.890s (-10.4% 🟢)2.113s21.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.680s (-1.2%)14.019s (~)0.338s51.00x
💻 LocalExpress13.737s (~)14.027s (~)0.290s51.00x
🐘 PostgresNitro13.778s (~)14.017s (~)0.239s51.01x
💻 LocalNitro13.794s (+1.2%)14.027s (~)0.233s51.01x
💻 LocalNext.js (Turbopack)13.945s (-2.9%)14.024s (-6.7% 🟢)0.079s51.02x
🐘 PostgresNext.js (Turbopack)14.479s (~)15.019s (~)0.540s41.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.786s (-32.9% 🟢)25.665s (-30.3% 🟢)1.879s31.00x
▲ VercelExpress28.078s (+15.9% 🔺)30.151s (+15.2% 🔺)2.073s21.18x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express12.277s (-1.3%)13.017s (~)0.739s71.00x
💻 LocalNitro12.293s (+1.8%)13.024s (+1.0%)0.732s71.00x
🐘 PostgresNitro12.332s (-1.5%)13.016s (~)0.685s71.00x
💻 LocalExpress12.377s (-1.4%)13.026s (~)0.649s71.01x
💻 LocalNext.js (Turbopack)12.996s (-4.8%)13.453s (-4.1%)0.457s71.06x
🐘 PostgresNext.js (Turbopack)13.672s (-1.4%)14.022s (-1.0%)0.350s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.089s (-11.3% 🟢)33.544s (-9.1% 🟢)2.455s31.00x
▲ VercelNext.js (Turbopack)32.851s (-6.7% 🟢)35.009s (-5.2% 🟢)2.158s31.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.184s (-2.4%)2.007s (~)0.823s151.00x
🐘 PostgresNitro1.188s (-0.9%)2.007s (~)0.818s151.00x
💻 LocalExpress1.218s (+4.5%)2.006s (~)0.788s151.03x
💻 LocalNitro1.221s (+4.4%)2.007s (~)0.786s151.03x
🐘 PostgresNext.js (Turbopack)1.254s (-2.5%)2.008s (~)0.754s151.06x
💻 LocalNext.js (Turbopack)1.314s (+1.4%)2.006s (~)0.692s151.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.610s (+62.7% 🔺)5.619s (+44.6% 🔺)2.008s61.00x
▲ VercelNext.js (Turbopack)4.317s (+61.9% 🔺)6.102s (+48.9% 🔺)1.785s51.20x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.280s (-6.2% 🟢)2.007s (-20.0% 🟢)0.728s151.00x
🐘 PostgresExpress1.345s (-5.6% 🟢)2.008s (-16.1% 🟢)0.663s151.05x
🐘 PostgresNext.js (Turbopack)1.420s (-13.3% 🟢)2.007s (-16.1% 🟢)0.588s151.11x
💻 LocalExpress2.080s (+27.9% 🔺)2.592s (+29.2% 🔺)0.512s121.63x
💻 LocalNitro2.114s (+36.2% 🔺)3.009s (+49.6% 🔺)0.895s101.65x
💻 LocalNext.js (Turbopack)2.244s (+17.5% 🔺)2.825s (+23.2% 🔺)0.581s111.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.282s (+8.1% 🔺)6.113s (+7.8% 🔺)1.831s51.00x
▲ VercelNext.js (Turbopack)5.293s (+17.9% 🔺)7.023s (+8.4% 🔺)1.730s51.24x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.454s (-17.5% 🟢)3.209s (-17.4% 🟢)1.755s101.00x
🐘 PostgresNitro1.514s (-5.1% 🟢)3.454s (-13.9% 🟢)1.940s91.04x
🐘 PostgresNext.js (Turbopack)2.397s (-24.1% 🟢)3.211s (-25.4% 🟢)0.813s101.65x
💻 LocalNext.js (Turbopack)4.863s (-15.8% 🟢)5.510s (-11.4% 🟢)0.648s63.34x
💻 LocalNitro5.437s (+58.8% 🔺)6.016s (+50.0% 🔺)0.579s53.74x
💻 LocalExpress5.607s (+28.3% 🔺)6.014s (+23.6% 🔺)0.406s63.86x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.175s (-6.0% 🟢)6.691s (-15.6% 🟢)1.516s51.00x
▲ VercelNext.js (Turbopack)5.635s (~)7.580s (-1.8%)1.945s41.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.188s (-2.4%)2.008s (~)0.820s151.00x
💻 LocalNitro1.233s (+2.7%)2.006s (~)0.773s151.04x
💻 LocalExpress1.234s (-21.7% 🟢)2.006s (~)0.772s151.04x
🐘 PostgresNext.js (Turbopack)1.252s (-2.2%)2.006s (~)0.754s151.05x
🐘 PostgresNitro1.255s (+3.6%)2.008s (~)0.753s151.06x
💻 LocalNext.js (Turbopack)1.356s (-3.1%)2.006s (~)0.650s151.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.577s (+54.0% 🔺)5.261s (+38.3% 🔺)1.684s61.00x
▲ VercelNext.js (Turbopack)3.682s (-1.0%)5.338s (+2.1%)1.656s61.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.288s (-5.7% 🟢)2.007s (-13.3% 🟢)0.720s151.00x
🐘 PostgresNitro1.304s (-9.6% 🟢)2.006s (-16.2% 🟢)0.702s151.01x
🐘 PostgresNext.js (Turbopack)1.421s (-7.9% 🟢)2.007s (-9.7% 🟢)0.586s151.10x
💻 LocalExpress2.015s (+6.2% 🔺)2.736s (+27.3% 🔺)0.720s111.57x
💻 LocalNitro2.098s (+23.9% 🔺)2.827s (+40.7% 🔺)0.728s111.63x
💻 LocalNext.js (Turbopack)2.189s (+0.9%)2.733s (-9.1% 🟢)0.545s111.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.608s (-19.2% 🟢)5.326s (-13.5% 🟢)1.718s61.00x
▲ VercelExpress3.823s (+40.3% 🔺)5.641s (+23.4% 🔺)1.818s61.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.434s (-20.5% 🟢)3.885s (-9.6% 🟢)2.451s81.00x
🐘 PostgresExpress1.505s (-16.4% 🟢)3.761s (-6.2% 🟢)2.256s81.05x
🐘 PostgresNext.js (Turbopack)2.441s (-40.0% 🟢)3.210s (-27.8% 🟢)0.769s101.70x
💻 LocalNext.js (Turbopack)5.325s (-8.3% 🟢)6.013s (-6.3% 🟢)0.688s53.71x
💻 LocalNitro5.552s (+23.6% 🔺)6.015s (+20.0% 🔺)0.463s63.87x
💻 LocalExpress5.867s (+27.8% 🔺)6.350s (+26.7% 🔺)0.483s64.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.865s (-42.3% 🟢)6.596s (-35.6% 🟢)1.731s51.00x
▲ VercelNext.js (Turbopack)6.204s (+64.0% 🔺)8.242s (+57.5% 🔺)2.038s41.28x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.528s (-11.1% 🟢)1.006s (-3.3%)0.478s601.00x
💻 LocalNitro0.563s (+12.6% 🔺)1.005s (~)0.442s601.07x
🐘 PostgresExpress0.572s (~)1.023s (+1.7%)0.450s591.08x
💻 LocalExpress0.606s (-3.0%)1.005s (-1.6%)0.399s601.15x
💻 LocalNext.js (Turbopack)0.701s (-21.0% 🟢)1.004s (-3.4%)0.303s601.33x
🐘 PostgresNext.js (Turbopack)0.785s (-6.1% 🟢)1.006s (-1.7%)0.221s601.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.871s (-22.8% 🟢)6.946s (-14.7% 🟢)2.074s91.00x
▲ VercelExpress5.110s (+12.4% 🔺)7.398s (+14.2% 🔺)2.287s91.05x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (-9.2% 🟢)2.052s (+1.1%)0.792s451.00x
🐘 PostgresExpress1.290s (-4.9%)2.030s (~)0.740s451.02x
💻 LocalNitro1.403s (+18.1% 🔺)2.006s (~)0.604s451.11x
💻 LocalExpress1.462s (-1.8%)2.006s (~)0.545s451.16x
💻 LocalNext.js (Turbopack)1.790s (-14.8% 🟢)2.005s (-33.3% 🟢)0.216s451.42x
🐘 PostgresNext.js (Turbopack)1.829s (-5.8% 🟢)2.030s (-2.2%)0.201s451.45x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.122s (-36.4% 🟢)13.375s (-30.2% 🟢)2.253s71.00x
▲ VercelNext.js (Turbopack)11.452s (-15.8% 🟢)13.422s (-12.4% 🟢)1.971s71.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.498s (-10.7% 🟢)3.033s (-4.2%)0.535s401.00x
🐘 PostgresExpress2.538s (-6.4% 🟢)3.033s (-2.5%)0.495s401.02x
💻 LocalNitro3.063s (+12.2% 🔺)3.626s (+12.5% 🔺)0.564s341.23x
💻 LocalExpress3.206s (~)4.009s (~)0.804s301.28x
🐘 PostgresNext.js (Turbopack)3.697s (-4.4%)4.009s (-1.6%)0.313s301.48x
💻 LocalNext.js (Turbopack)3.828s (-11.9% 🟢)4.146s (-17.2% 🟢)0.318s291.53x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.676s (-16.9% 🟢)24.156s (-13.8% 🟢)2.480s61.00x
▲ VercelNext.js (Turbopack)23.635s (-5.4% 🟢)25.770s (-3.8%)2.134s51.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.216s (-8.1% 🟢)1.006s (~)0.789s601.00x
🐘 PostgresExpress0.221s (-4.5%)1.006s (~)0.785s601.02x
🐘 PostgresNext.js (Turbopack)0.261s (-11.3% 🟢)1.006s (~)0.745s601.21x
💻 LocalNitro0.428s (+14.9% 🔺)1.005s (~)0.576s601.98x
💻 LocalExpress0.430s (-2.2%)1.005s (~)0.574s601.99x
💻 LocalNext.js (Turbopack)0.559s (-4.0%)1.004s (~)0.445s602.58x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.453s (+58.2% 🔺)4.282s (+49.3% 🔺)1.830s151.00x
▲ VercelNext.js (Turbopack)2.537s (+35.5% 🔺)4.323s (+11.2% 🔺)1.787s141.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.314s (-11.6% 🟢)1.006s (-3.3%)0.692s901.00x
🐘 PostgresNitro0.325s (-5.0%)1.017s (~)0.692s891.04x
🐘 PostgresNext.js (Turbopack)0.435s (-19.2% 🟢)1.006s (-10.0% 🟢)0.571s901.39x
💻 LocalNitro2.092s (+37.3% 🔺)2.537s (+17.9% 🔺)0.444s366.66x
💻 LocalExpress2.133s (+2.1%)2.581s (-2.8%)0.448s356.79x
💻 LocalNext.js (Turbopack)2.357s (+1.1%)3.010s (-2.1%)0.653s307.50x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.706s (-7.5% 🟢)4.760s (-0.8%)2.054s201.00x
▲ VercelNext.js (Turbopack)3.147s (+3.4%)4.862s (+1.5%)1.715s191.16x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.517s (-9.0% 🟢)1.059s (-14.1% 🟢)0.542s1141.00x
🐘 PostgresExpress0.517s (-9.1% 🟢)1.107s (-9.0% 🟢)0.590s1091.00x
🐘 PostgresNext.js (Turbopack)1.665s (-36.4% 🟢)2.403s (-30.8% 🟢)0.738s513.22x
💻 LocalNext.js (Turbopack)9.274s (-13.8% 🟢)10.192s (-11.9% 🟢)0.918s1217.94x
💻 LocalExpress10.126s (+21.9% 🔺)10.779s (+21.4% 🔺)0.653s1219.59x
💻 LocalNitro10.299s (+63.2% 🔺)10.945s (+62.3% 🔺)0.646s1219.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.010s (-26.6% 🟢)6.009s (-15.2% 🟢)1.998s201.00x
▲ VercelNext.js (Turbopack)5.104s (+5.4% 🔺)6.996s (+7.1% 🔺)1.892s181.27x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.157s (-1.8%)1.999s (~)0.001s (-18.2% 🟢)2.010s (~)0.853s101.00x
🐘 PostgresNitro1.164s (~)1.999s (~)0.001s (+20.0% 🔺)2.010s (~)0.847s101.01x
💻 LocalNitro1.167s (+4.4%)2.006s (~)0.012s (-55.4% 🟢)2.020s (-0.9%)0.853s101.01x
💻 LocalExpress1.170s (+1.7%)2.005s (~)0.012s (+20.8% 🔺)2.020s (~)0.850s101.01x
💻 LocalNext.js (Turbopack)1.184s (-2.2%)2.002s (~)0.008s (-36.0% 🟢)2.014s (~)0.830s101.02x
🐘 PostgresNext.js (Turbopack)1.217s (-1.0%)2.001s (~)0.001s (-30.8% 🟢)2.010s (~)0.793s101.05x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.670s (+5.9% 🔺)3.838s (~)4.711s (+483.4% 🔺)9.069s (+78.4% 🔺)6.399s101.00x
▲ VercelExpress2.901s (+20.8% 🔺)4.452s (+21.0% 🔺)4.320s (+483.0% 🔺)9.303s (+90.8% 🔺)6.401s101.09x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.552s (-2.0%)2.003s (~)0.005s (+11.4% 🔺)2.026s (~)0.474s301.00x
🐘 PostgresNitro1.566s (-0.8%)2.005s (~)0.005s (-9.9% 🟢)2.026s (~)0.460s301.01x
💻 LocalNitro1.568s (+9.1% 🔺)2.011s (~)0.014s (-24.0% 🟢)2.026s (~)0.458s301.01x
💻 LocalExpress1.588s (+1.4%)2.010s (~)0.011s (-13.7% 🟢)2.023s (~)0.435s301.02x
💻 LocalNext.js (Turbopack)1.614s (-7.8% 🟢)2.008s (~)0.012s (-5.7% 🟢)2.022s (~)0.408s301.04x
🐘 PostgresNext.js (Turbopack)1.755s (-1.7%)2.010s (~)0.005s (-0.6%)2.025s (~)0.269s301.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.320s (+30.3% 🔺)10.378s (+32.9% 🔺)0.371s (+107.3% 🔺)11.213s (+32.6% 🔺)2.892s61.00x
▲ VercelNext.js (Turbopack)8.347s (-1.7%)10.004s (+1.9%)0.488s (+85.4% 🔺)10.955s (+3.6%)2.608s61.00x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.737s (-4.7%)1.064s (+1.5%)0.000s (+96.4% 🔺)1.086s (-0.7%)0.349s561.00x
🐘 PostgresExpress0.754s (-1.3%)1.046s (+2.1%)0.000s (-50.0% 🟢)1.060s (~)0.306s571.02x
🐘 PostgresNext.js (Turbopack)0.916s (-10.2% 🟢)1.250s (-14.6% 🟢)0.000s (-57.3% 🟢)1.257s (-14.6% 🟢)0.341s481.24x
💻 LocalNext.js (Turbopack)1.433s (-5.3% 🟢)1.917s (-4.8%)0.000s (-37.5% 🟢)1.919s (-4.8%)0.486s321.95x
💻 LocalNitro1.451s (+34.9% 🔺)2.014s (+9.6% 🔺)0.000s (-52.9% 🟢)2.016s (+9.6% 🔺)0.566s301.97x
💻 LocalExpress1.572s (+15.4% 🔺)2.014s (~)0.000s (~)2.016s (~)0.444s302.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.647s (+34.8% 🔺)6.077s (+27.4% 🔺)0.000s (+20.0% 🔺)6.573s (+24.9% 🔺)1.926s101.00x
▲ VercelExpress5.355s (+76.7% 🔺)6.649s (+45.7% 🔺)0.000s (+Infinity% 🔺)7.225s (+43.4% 🔺)1.869s91.15x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.446s (-10.4% 🟢)2.100s (+1.8%)0.000s (NaN%)2.120s (+1.5%)0.674s291.00x
🐘 PostgresNitro1.601s (+3.2%)2.172s (+1.8%)0.000s (-100.0% 🟢)2.194s (+2.2%)0.593s281.11x
🐘 PostgresNext.js (Turbopack)2.201s (+4.3%)2.609s (+0.8%)0.000s (-100.0% 🟢)2.618s (+0.8%)0.417s231.52x
💻 LocalNext.js (Turbopack)3.608s (+24.4% 🔺)4.283s (+27.6% 🔺)0.001s (+126.7% 🔺)4.295s (+27.7% 🔺)0.688s152.49x
💻 LocalNitro3.665s (+66.1% 🔺)4.310s (+57.2% 🔺)0.001s (-10.2% 🟢)4.321s (+56.9% 🔺)0.656s142.53x
💻 LocalExpress4.419s (+50.8% 🔺)4.870s (+32.7% 🔺)0.000s (+4.6%)4.880s (+32.8% 🔺)0.461s133.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.466s (+13.6% 🔺)7.920s (+9.6% 🔺)0.000s (+Infinity% 🔺)8.414s (+9.4% 🔺)1.949s81.00x
▲ VercelNext.js (Turbopack)6.901s (-4.8%)8.409s (~)0.013s (+10071.4% 🔺)8.839s (~)1.938s71.07x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresExpress12/21
▲ VercelExpress15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres19/21
Next.js (Turbopack)🐘 Postgres12/21
Nitro🐘 Postgres17/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


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the full diff, built @workflow/core + @workflow/builders clean, and ran the affected tests (script-cache, runtime, constants, get-workflow-filenames) locally — all green.

The design is nicely fail-safe: workflowFilenames is best-effort, and a wrong/missing/extra filename only ever degrades to a cache miss → lazy compile (exactly today's behavior), with no determinism or correctness risk. The filename derivation also lines up with the runtime: since the registry lookup __private_workflows.get(workflowName) has to succeed, workflowName === workflowId, so the build-time moduleSpecifier matches what runWorkflow compiles under. Tests, comments, and the namespace-options refactor all look solid.

One tradeoff I'd like validated before merge (inline on runtime.ts), plus two smaller notes. Nothing blocking.

// (for stack-trace attribution); the builder passes that deduplicated set of
// filenames. When none are provided, fall back to a single representative
// filename so the bulk top-level parse is still done eagerly.
precompileWorkflowBundle(workflowCode, options?.workflowFilenames);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth validating against a multi-file benchmark. This eagerly compiles the full bundle once per workflow source file at module init — getCachedWorkflowScript does new Script(fullBundle, { filename }) per filename, and V8 keys its script compilation cache on the filename as well as the source, so there's no parse sharing across them (the existing script-cache.ts doc already notes "the whole bundle is compiled once per distinct filename").

The lazy path only ever compiled the filenames of workflows this process actually served. For an app with many workflow files where a given serverless instance only handles a subset, this front-loads — and increases total — cold-start parse work for workflows that may never run on this instance. The first-request win is real only if module init runs off that request's critical path on the platform; otherwise end-to-end latency for the first invocation could regress as the number of source files grows.

Does the benchmark cover an app with many distinct workflow source files (not just many functions in one file)? If not, that's the case I'd most want to see before merging.

* filename compiles the bulk of the bundle; the per-workflow filenames then
* recompile lazily (a cheap re-parse) on first replay.
*/
const PRECOMPILE_FALLBACK_FILENAME = '<workflow-bundle>';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fallback doesn't actually move any parse cost off the first replay. It caches a Script under <workflow-bundle>, but runWorkflow looks it up under the real moduleSpecifier, so the first replay still does a full new Script(...) under that real filename (different filename ⇒ full recompile, no reuse of the fallback entry). So the no-filenames path pays an extra full top-level parse at init for a Script that is never read, then parses again at replay — net overhead plus a dead cache entry, not a saving.

Since the builders now always pass workflowFilenames, this only affects manual/legacy callers, so it's low-impact. But consider either making the no-filenames case a no-op, or tightening the comment here and at lines 327-330 — both currently read as if the fallback warms the replay path, which it doesn't.

getQueueTopicPrefix('workflow', namespace);
const workflowFilenames = options?.workflowFilenames;
if (workflowFilenames && workflowFilenames.length > 0) {
const sorted = [...new Set(workflowFilenames)].sort();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor/nit: getWorkflowFilenamesFromManifest already returns a deduped, sorted array, so for the builder call sites this new Set(...).sort() is redundant work. It's harmless and reasonable as defensive normalization for direct callers of createWorkflowEntrypointOptionsCode — just flagging the double dedup/sort in case you'd rather pick one layer to own it.

Sign up for freeto 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

@TooTallNate@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
perf(core): precompile workflow vm.Script at module init by TooTallNate · Pull Request #2524 · vercel/workflow · GitHub
Skip to content

perf(core): precompile workflow vm.Script at module init - #2524

Open
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init
Open

perf(core): precompile workflow vm.Script at module init#2524
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init

Conversation

@TooTallNate

Copy link
Copy Markdown
Member

Summary

  • Precompile the workflow bundle's vm.Script at module-init time (when workflowEntrypoint is constructed) instead of lazily on the first queue delivery's replay, so the first replay is a cache hit rather than paying the bundle parse/compile on the critical path.
  • workflowEntrypoint gains an optional workflowFilenames option; the builders inline the deduplicated, sorted set of workflow source filenames into generated routes so the precompiled Script matches exactly what runWorkflow compiles under (parseWorkflowName(name)?.moduleSpecifier || name).
  • When no filenames are provided, the bundle is still precompiled once under a representative filename to pay the bulk top-level parse early.

Details

  • packages/core/src/vm/script-cache.ts: add precompileWorkflowScripts() (swallows compile errors so module init never breaks) and an isWorkflowScriptCached() test inspector.
  • packages/core/src/runtime.ts: workflowEntrypoint(workflowCode, { namespace?, workflowFilenames? }) warms the compiled-bundle cache at construction time.
  • packages/builders: getWorkflowFilenamesFromManifest() derives the per-file source filenames from the manifest's workflowIds; wired into all generated-route sites (base-builder workflow-only / combined / combined-watch, builder-deferred watch / production) via createWorkflowEntrypointOptionsCode({ workflowFilenames }).

Verified end-to-end against the example workbench: the generated flow route emits workflowEntrypoint(workflowCode, { workflowFilenames: [...] }) with the deduplicated, sorted filenames.

Testing

  • New unit tests: precompileWorkflowScripts (cache warming, identical-to-lazy Script, empty list, swallows syntax errors), createWorkflowEntrypointOptionsCode (filenames dedup/sort/combine), getWorkflowFilenamesFromManifest, and a workflowEntrypoint module-init precompile assertion.
  • @workflow/core and @workflow/builders build clean; affected test files pass.

Changeset

  • @workflow/core: minor (new workflowFilenames option + module-init precompile)
  • @workflow/builders, @workflow/next: patch (route wiring)

Compile the workflow bundle's `vm.Script` for each known workflow source
filename when `workflowEntrypoint` is constructed (module-init time),
rather than lazily on the first queue delivery's replay. Builders inline
the deduplicated, sorted set of workflow filenames into generated routes
via the new `workflowFilenames` entrypoint option, so the first replay is
a cache hit instead of paying the bundle parse/compile on the critical
path.
@TooTallNate
TooTallNate requested review from a team and ijjk as code ownersJune 18, 2026 21:36
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1ffc078

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

This PR includes changesets to release 16 packages
NameType
@workflow/buildersPatch
@workflow/nextPatch
@workflow/coreMinor
@workflow/astroPatch
@workflow/cliPatch
@workflow/nestPatch
@workflow/nitroPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/vitestPatch
workflowMinor
@workflow/web-sharedPatch
@workflow/webPatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production144022301672
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total8190210809272

❌ Failed Tests

▲ Vercel Production (2 failed)

astro (1 failed):

  • distributedAbortController - manual abort triggers signal | wrun_01KVEBJBCKBY07V9DFPPPE04VN | 🔍 observability

nextjs-turbopack (1 failed):

  • cancelRun via CLI - cancelling a running workflow | wrun_01KVEBB1EZ7BG88HYXXJCCJTXY | 🔍 observability

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro124127
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
❌ nextjs-turbopack14813
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.042s (-4.1%)1.006s (~)0.965s101.00x
💻 LocalNitro0.042s (+2.7%)1.005s (~)0.964s101.00x
💻 LocalNext.js (Turbopack)0.045s (-31.7% 🟢)1.005s (~)0.960s101.08x
🐘 PostgresExpress0.059s (-18.9% 🟢)1.012s (~)0.953s101.42x
🐘 PostgresNext.js (Turbopack)0.065s (-7.4% 🟢)1.012s (~)0.947s101.56x
🐘 PostgresNitro0.065s (+3.7%)1.013s (~)0.947s101.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.451s (+19.6% 🔺)2.595s (+13.1% 🔺)2.144s101.00x
▲ VercelNext.js (Turbopack)0.478s (+64.4% 🔺)2.473s (+30.7% 🔺)1.994s101.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.092s (+0.6%)2.005s (~)0.914s101.00x
💻 LocalExpress1.093s (-0.8%)2.006s (~)0.914s101.00x
🐘 PostgresNitro1.097s (-2.1%)2.008s (~)0.911s101.00x
🐘 PostgresExpress1.102s (~)2.010s (~)0.907s101.01x
💻 LocalNext.js (Turbopack)1.108s (-3.5%)2.006s (~)0.897s101.01x
🐘 PostgresNext.js (Turbopack)1.135s (-0.5%)2.009s (~)0.874s101.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.703s (-12.0% 🟢)3.912s (+6.4% 🔺)2.209s101.00x
▲ VercelNext.js (Turbopack)2.352s (+33.3% 🔺)4.394s (+18.4% 🔺)2.042s101.38x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.497s (~)11.016s (~)0.519s31.00x
🐘 PostgresNitro10.525s (~)11.018s (~)0.492s31.00x
💻 LocalNitro10.527s (~)11.023s (~)0.496s31.00x
💻 LocalExpress10.540s (~)11.023s (~)0.483s31.00x
💻 LocalNext.js (Turbopack)10.606s (-1.8%)11.021s (~)0.415s31.01x
🐘 PostgresNext.js (Turbopack)10.796s (-0.6%)11.018s (~)0.222s31.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)14.860s (+3.8%)16.723s (+2.6%)1.863s21.00x
▲ VercelExpress15.777s (-12.7% 🟢)17.890s (-10.4% 🟢)2.113s21.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.680s (-1.2%)14.019s (~)0.338s51.00x
💻 LocalExpress13.737s (~)14.027s (~)0.290s51.00x
🐘 PostgresNitro13.778s (~)14.017s (~)0.239s51.01x
💻 LocalNitro13.794s (+1.2%)14.027s (~)0.233s51.01x
💻 LocalNext.js (Turbopack)13.945s (-2.9%)14.024s (-6.7% 🟢)0.079s51.02x
🐘 PostgresNext.js (Turbopack)14.479s (~)15.019s (~)0.540s41.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.786s (-32.9% 🟢)25.665s (-30.3% 🟢)1.879s31.00x
▲ VercelExpress28.078s (+15.9% 🔺)30.151s (+15.2% 🔺)2.073s21.18x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express12.277s (-1.3%)13.017s (~)0.739s71.00x
💻 LocalNitro12.293s (+1.8%)13.024s (+1.0%)0.732s71.00x
🐘 PostgresNitro12.332s (-1.5%)13.016s (~)0.685s71.00x
💻 LocalExpress12.377s (-1.4%)13.026s (~)0.649s71.01x
💻 LocalNext.js (Turbopack)12.996s (-4.8%)13.453s (-4.1%)0.457s71.06x
🐘 PostgresNext.js (Turbopack)13.672s (-1.4%)14.022s (-1.0%)0.350s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.089s (-11.3% 🟢)33.544s (-9.1% 🟢)2.455s31.00x
▲ VercelNext.js (Turbopack)32.851s (-6.7% 🟢)35.009s (-5.2% 🟢)2.158s31.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.184s (-2.4%)2.007s (~)0.823s151.00x
🐘 PostgresNitro1.188s (-0.9%)2.007s (~)0.818s151.00x
💻 LocalExpress1.218s (+4.5%)2.006s (~)0.788s151.03x
💻 LocalNitro1.221s (+4.4%)2.007s (~)0.786s151.03x
🐘 PostgresNext.js (Turbopack)1.254s (-2.5%)2.008s (~)0.754s151.06x
💻 LocalNext.js (Turbopack)1.314s (+1.4%)2.006s (~)0.692s151.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.610s (+62.7% 🔺)5.619s (+44.6% 🔺)2.008s61.00x
▲ VercelNext.js (Turbopack)4.317s (+61.9% 🔺)6.102s (+48.9% 🔺)1.785s51.20x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.280s (-6.2% 🟢)2.007s (-20.0% 🟢)0.728s151.00x
🐘 PostgresExpress1.345s (-5.6% 🟢)2.008s (-16.1% 🟢)0.663s151.05x
🐘 PostgresNext.js (Turbopack)1.420s (-13.3% 🟢)2.007s (-16.1% 🟢)0.588s151.11x
💻 LocalExpress2.080s (+27.9% 🔺)2.592s (+29.2% 🔺)0.512s121.63x
💻 LocalNitro2.114s (+36.2% 🔺)3.009s (+49.6% 🔺)0.895s101.65x
💻 LocalNext.js (Turbopack)2.244s (+17.5% 🔺)2.825s (+23.2% 🔺)0.581s111.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.282s (+8.1% 🔺)6.113s (+7.8% 🔺)1.831s51.00x
▲ VercelNext.js (Turbopack)5.293s (+17.9% 🔺)7.023s (+8.4% 🔺)1.730s51.24x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.454s (-17.5% 🟢)3.209s (-17.4% 🟢)1.755s101.00x
🐘 PostgresNitro1.514s (-5.1% 🟢)3.454s (-13.9% 🟢)1.940s91.04x
🐘 PostgresNext.js (Turbopack)2.397s (-24.1% 🟢)3.211s (-25.4% 🟢)0.813s101.65x
💻 LocalNext.js (Turbopack)4.863s (-15.8% 🟢)5.510s (-11.4% 🟢)0.648s63.34x
💻 LocalNitro5.437s (+58.8% 🔺)6.016s (+50.0% 🔺)0.579s53.74x
💻 LocalExpress5.607s (+28.3% 🔺)6.014s (+23.6% 🔺)0.406s63.86x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.175s (-6.0% 🟢)6.691s (-15.6% 🟢)1.516s51.00x
▲ VercelNext.js (Turbopack)5.635s (~)7.580s (-1.8%)1.945s41.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.188s (-2.4%)2.008s (~)0.820s151.00x
💻 LocalNitro1.233s (+2.7%)2.006s (~)0.773s151.04x
💻 LocalExpress1.234s (-21.7% 🟢)2.006s (~)0.772s151.04x
🐘 PostgresNext.js (Turbopack)1.252s (-2.2%)2.006s (~)0.754s151.05x
🐘 PostgresNitro1.255s (+3.6%)2.008s (~)0.753s151.06x
💻 LocalNext.js (Turbopack)1.356s (-3.1%)2.006s (~)0.650s151.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.577s (+54.0% 🔺)5.261s (+38.3% 🔺)1.684s61.00x
▲ VercelNext.js (Turbopack)3.682s (-1.0%)5.338s (+2.1%)1.656s61.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.288s (-5.7% 🟢)2.007s (-13.3% 🟢)0.720s151.00x
🐘 PostgresNitro1.304s (-9.6% 🟢)2.006s (-16.2% 🟢)0.702s151.01x
🐘 PostgresNext.js (Turbopack)1.421s (-7.9% 🟢)2.007s (-9.7% 🟢)0.586s151.10x
💻 LocalExpress2.015s (+6.2% 🔺)2.736s (+27.3% 🔺)0.720s111.57x
💻 LocalNitro2.098s (+23.9% 🔺)2.827s (+40.7% 🔺)0.728s111.63x
💻 LocalNext.js (Turbopack)2.189s (+0.9%)2.733s (-9.1% 🟢)0.545s111.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.608s (-19.2% 🟢)5.326s (-13.5% 🟢)1.718s61.00x
▲ VercelExpress3.823s (+40.3% 🔺)5.641s (+23.4% 🔺)1.818s61.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.434s (-20.5% 🟢)3.885s (-9.6% 🟢)2.451s81.00x
🐘 PostgresExpress1.505s (-16.4% 🟢)3.761s (-6.2% 🟢)2.256s81.05x
🐘 PostgresNext.js (Turbopack)2.441s (-40.0% 🟢)3.210s (-27.8% 🟢)0.769s101.70x
💻 LocalNext.js (Turbopack)5.325s (-8.3% 🟢)6.013s (-6.3% 🟢)0.688s53.71x
💻 LocalNitro5.552s (+23.6% 🔺)6.015s (+20.0% 🔺)0.463s63.87x
💻 LocalExpress5.867s (+27.8% 🔺)6.350s (+26.7% 🔺)0.483s64.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.865s (-42.3% 🟢)6.596s (-35.6% 🟢)1.731s51.00x
▲ VercelNext.js (Turbopack)6.204s (+64.0% 🔺)8.242s (+57.5% 🔺)2.038s41.28x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.528s (-11.1% 🟢)1.006s (-3.3%)0.478s601.00x
💻 LocalNitro0.563s (+12.6% 🔺)1.005s (~)0.442s601.07x
🐘 PostgresExpress0.572s (~)1.023s (+1.7%)0.450s591.08x
💻 LocalExpress0.606s (-3.0%)1.005s (-1.6%)0.399s601.15x
💻 LocalNext.js (Turbopack)0.701s (-21.0% 🟢)1.004s (-3.4%)0.303s601.33x
🐘 PostgresNext.js (Turbopack)0.785s (-6.1% 🟢)1.006s (-1.7%)0.221s601.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.871s (-22.8% 🟢)6.946s (-14.7% 🟢)2.074s91.00x
▲ VercelExpress5.110s (+12.4% 🔺)7.398s (+14.2% 🔺)2.287s91.05x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (-9.2% 🟢)2.052s (+1.1%)0.792s451.00x
🐘 PostgresExpress1.290s (-4.9%)2.030s (~)0.740s451.02x
💻 LocalNitro1.403s (+18.1% 🔺)2.006s (~)0.604s451.11x
💻 LocalExpress1.462s (-1.8%)2.006s (~)0.545s451.16x
💻 LocalNext.js (Turbopack)1.790s (-14.8% 🟢)2.005s (-33.3% 🟢)0.216s451.42x
🐘 PostgresNext.js (Turbopack)1.829s (-5.8% 🟢)2.030s (-2.2%)0.201s451.45x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.122s (-36.4% 🟢)13.375s (-30.2% 🟢)2.253s71.00x
▲ VercelNext.js (Turbopack)11.452s (-15.8% 🟢)13.422s (-12.4% 🟢)1.971s71.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.498s (-10.7% 🟢)3.033s (-4.2%)0.535s401.00x
🐘 PostgresExpress2.538s (-6.4% 🟢)3.033s (-2.5%)0.495s401.02x
💻 LocalNitro3.063s (+12.2% 🔺)3.626s (+12.5% 🔺)0.564s341.23x
💻 LocalExpress3.206s (~)4.009s (~)0.804s301.28x
🐘 PostgresNext.js (Turbopack)3.697s (-4.4%)4.009s (-1.6%)0.313s301.48x
💻 LocalNext.js (Turbopack)3.828s (-11.9% 🟢)4.146s (-17.2% 🟢)0.318s291.53x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.676s (-16.9% 🟢)24.156s (-13.8% 🟢)2.480s61.00x
▲ VercelNext.js (Turbopack)23.635s (-5.4% 🟢)25.770s (-3.8%)2.134s51.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.216s (-8.1% 🟢)1.006s (~)0.789s601.00x
🐘 PostgresExpress0.221s (-4.5%)1.006s (~)0.785s601.02x
🐘 PostgresNext.js (Turbopack)0.261s (-11.3% 🟢)1.006s (~)0.745s601.21x
💻 LocalNitro0.428s (+14.9% 🔺)1.005s (~)0.576s601.98x
💻 LocalExpress0.430s (-2.2%)1.005s (~)0.574s601.99x
💻 LocalNext.js (Turbopack)0.559s (-4.0%)1.004s (~)0.445s602.58x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.453s (+58.2% 🔺)4.282s (+49.3% 🔺)1.830s151.00x
▲ VercelNext.js (Turbopack)2.537s (+35.5% 🔺)4.323s (+11.2% 🔺)1.787s141.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.314s (-11.6% 🟢)1.006s (-3.3%)0.692s901.00x
🐘 PostgresNitro0.325s (-5.0%)1.017s (~)0.692s891.04x
🐘 PostgresNext.js (Turbopack)0.435s (-19.2% 🟢)1.006s (-10.0% 🟢)0.571s901.39x
💻 LocalNitro2.092s (+37.3% 🔺)2.537s (+17.9% 🔺)0.444s366.66x
💻 LocalExpress2.133s (+2.1%)2.581s (-2.8%)0.448s356.79x
💻 LocalNext.js (Turbopack)2.357s (+1.1%)3.010s (-2.1%)0.653s307.50x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.706s (-7.5% 🟢)4.760s (-0.8%)2.054s201.00x
▲ VercelNext.js (Turbopack)3.147s (+3.4%)4.862s (+1.5%)1.715s191.16x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.517s (-9.0% 🟢)1.059s (-14.1% 🟢)0.542s1141.00x
🐘 PostgresExpress0.517s (-9.1% 🟢)1.107s (-9.0% 🟢)0.590s1091.00x
🐘 PostgresNext.js (Turbopack)1.665s (-36.4% 🟢)2.403s (-30.8% 🟢)0.738s513.22x
💻 LocalNext.js (Turbopack)9.274s (-13.8% 🟢)10.192s (-11.9% 🟢)0.918s1217.94x
💻 LocalExpress10.126s (+21.9% 🔺)10.779s (+21.4% 🔺)0.653s1219.59x
💻 LocalNitro10.299s (+63.2% 🔺)10.945s (+62.3% 🔺)0.646s1219.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.010s (-26.6% 🟢)6.009s (-15.2% 🟢)1.998s201.00x
▲ VercelNext.js (Turbopack)5.104s (+5.4% 🔺)6.996s (+7.1% 🔺)1.892s181.27x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.157s (-1.8%)1.999s (~)0.001s (-18.2% 🟢)2.010s (~)0.853s101.00x
🐘 PostgresNitro1.164s (~)1.999s (~)0.001s (+20.0% 🔺)2.010s (~)0.847s101.01x
💻 LocalNitro1.167s (+4.4%)2.006s (~)0.012s (-55.4% 🟢)2.020s (-0.9%)0.853s101.01x
💻 LocalExpress1.170s (+1.7%)2.005s (~)0.012s (+20.8% 🔺)2.020s (~)0.850s101.01x
💻 LocalNext.js (Turbopack)1.184s (-2.2%)2.002s (~)0.008s (-36.0% 🟢)2.014s (~)0.830s101.02x
🐘 PostgresNext.js (Turbopack)1.217s (-1.0%)2.001s (~)0.001s (-30.8% 🟢)2.010s (~)0.793s101.05x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.670s (+5.9% 🔺)3.838s (~)4.711s (+483.4% 🔺)9.069s (+78.4% 🔺)6.399s101.00x
▲ VercelExpress2.901s (+20.8% 🔺)4.452s (+21.0% 🔺)4.320s (+483.0% 🔺)9.303s (+90.8% 🔺)6.401s101.09x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.552s (-2.0%)2.003s (~)0.005s (+11.4% 🔺)2.026s (~)0.474s301.00x
🐘 PostgresNitro1.566s (-0.8%)2.005s (~)0.005s (-9.9% 🟢)2.026s (~)0.460s301.01x
💻 LocalNitro1.568s (+9.1% 🔺)2.011s (~)0.014s (-24.0% 🟢)2.026s (~)0.458s301.01x
💻 LocalExpress1.588s (+1.4%)2.010s (~)0.011s (-13.7% 🟢)2.023s (~)0.435s301.02x
💻 LocalNext.js (Turbopack)1.614s (-7.8% 🟢)2.008s (~)0.012s (-5.7% 🟢)2.022s (~)0.408s301.04x
🐘 PostgresNext.js (Turbopack)1.755s (-1.7%)2.010s (~)0.005s (-0.6%)2.025s (~)0.269s301.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.320s (+30.3% 🔺)10.378s (+32.9% 🔺)0.371s (+107.3% 🔺)11.213s (+32.6% 🔺)2.892s61.00x
▲ VercelNext.js (Turbopack)8.347s (-1.7%)10.004s (+1.9%)0.488s (+85.4% 🔺)10.955s (+3.6%)2.608s61.00x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.737s (-4.7%)1.064s (+1.5%)0.000s (+96.4% 🔺)1.086s (-0.7%)0.349s561.00x
🐘 PostgresExpress0.754s (-1.3%)1.046s (+2.1%)0.000s (-50.0% 🟢)1.060s (~)0.306s571.02x
🐘 PostgresNext.js (Turbopack)0.916s (-10.2% 🟢)1.250s (-14.6% 🟢)0.000s (-57.3% 🟢)1.257s (-14.6% 🟢)0.341s481.24x
💻 LocalNext.js (Turbopack)1.433s (-5.3% 🟢)1.917s (-4.8%)0.000s (-37.5% 🟢)1.919s (-4.8%)0.486s321.95x
💻 LocalNitro1.451s (+34.9% 🔺)2.014s (+9.6% 🔺)0.000s (-52.9% 🟢)2.016s (+9.6% 🔺)0.566s301.97x
💻 LocalExpress1.572s (+15.4% 🔺)2.014s (~)0.000s (~)2.016s (~)0.444s302.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.647s (+34.8% 🔺)6.077s (+27.4% 🔺)0.000s (+20.0% 🔺)6.573s (+24.9% 🔺)1.926s101.00x
▲ VercelExpress5.355s (+76.7% 🔺)6.649s (+45.7% 🔺)0.000s (+Infinity% 🔺)7.225s (+43.4% 🔺)1.869s91.15x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.446s (-10.4% 🟢)2.100s (+1.8%)0.000s (NaN%)2.120s (+1.5%)0.674s291.00x
🐘 PostgresNitro1.601s (+3.2%)2.172s (+1.8%)0.000s (-100.0% 🟢)2.194s (+2.2%)0.593s281.11x
🐘 PostgresNext.js (Turbopack)2.201s (+4.3%)2.609s (+0.8%)0.000s (-100.0% 🟢)2.618s (+0.8%)0.417s231.52x
💻 LocalNext.js (Turbopack)3.608s (+24.4% 🔺)4.283s (+27.6% 🔺)0.001s (+126.7% 🔺)4.295s (+27.7% 🔺)0.688s152.49x
💻 LocalNitro3.665s (+66.1% 🔺)4.310s (+57.2% 🔺)0.001s (-10.2% 🟢)4.321s (+56.9% 🔺)0.656s142.53x
💻 LocalExpress4.419s (+50.8% 🔺)4.870s (+32.7% 🔺)0.000s (+4.6%)4.880s (+32.8% 🔺)0.461s133.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.466s (+13.6% 🔺)7.920s (+9.6% 🔺)0.000s (+Infinity% 🔺)8.414s (+9.4% 🔺)1.949s81.00x
▲ VercelNext.js (Turbopack)6.901s (-4.8%)8.409s (~)0.013s (+10071.4% 🔺)8.839s (~)1.938s71.07x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresExpress12/21
▲ VercelExpress15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres19/21
Next.js (Turbopack)🐘 Postgres12/21
Nitro🐘 Postgres17/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


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the full diff, built @workflow/core + @workflow/builders clean, and ran the affected tests (script-cache, runtime, constants, get-workflow-filenames) locally — all green.

The design is nicely fail-safe: workflowFilenames is best-effort, and a wrong/missing/extra filename only ever degrades to a cache miss → lazy compile (exactly today's behavior), with no determinism or correctness risk. The filename derivation also lines up with the runtime: since the registry lookup __private_workflows.get(workflowName) has to succeed, workflowName === workflowId, so the build-time moduleSpecifier matches what runWorkflow compiles under. Tests, comments, and the namespace-options refactor all look solid.

One tradeoff I'd like validated before merge (inline on runtime.ts), plus two smaller notes. Nothing blocking.

// (for stack-trace attribution); the builder passes that deduplicated set of
// filenames. When none are provided, fall back to a single representative
// filename so the bulk top-level parse is still done eagerly.
precompileWorkflowBundle(workflowCode, options?.workflowFilenames);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth validating against a multi-file benchmark. This eagerly compiles the full bundle once per workflow source file at module init — getCachedWorkflowScript does new Script(fullBundle, { filename }) per filename, and V8 keys its script compilation cache on the filename as well as the source, so there's no parse sharing across them (the existing script-cache.ts doc already notes "the whole bundle is compiled once per distinct filename").

The lazy path only ever compiled the filenames of workflows this process actually served. For an app with many workflow files where a given serverless instance only handles a subset, this front-loads — and increases total — cold-start parse work for workflows that may never run on this instance. The first-request win is real only if module init runs off that request's critical path on the platform; otherwise end-to-end latency for the first invocation could regress as the number of source files grows.

Does the benchmark cover an app with many distinct workflow source files (not just many functions in one file)? If not, that's the case I'd most want to see before merging.

* filename compiles the bulk of the bundle; the per-workflow filenames then
* recompile lazily (a cheap re-parse) on first replay.
*/
const PRECOMPILE_FALLBACK_FILENAME = '<workflow-bundle>';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fallback doesn't actually move any parse cost off the first replay. It caches a Script under <workflow-bundle>, but runWorkflow looks it up under the real moduleSpecifier, so the first replay still does a full new Script(...) under that real filename (different filename ⇒ full recompile, no reuse of the fallback entry). So the no-filenames path pays an extra full top-level parse at init for a Script that is never read, then parses again at replay — net overhead plus a dead cache entry, not a saving.

Since the builders now always pass workflowFilenames, this only affects manual/legacy callers, so it's low-impact. But consider either making the no-filenames case a no-op, or tightening the comment here and at lines 327-330 — both currently read as if the fallback warms the replay path, which it doesn't.

getQueueTopicPrefix('workflow', namespace);
const workflowFilenames = options?.workflowFilenames;
if (workflowFilenames && workflowFilenames.length > 0) {
const sorted = [...new Set(workflowFilenames)].sort();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor/nit: getWorkflowFilenamesFromManifest already returns a deduped, sorted array, so for the builder call sites this new Set(...).sort() is redundant work. It's harmless and reasonable as defensive normalization for direct callers of createWorkflowEntrypointOptionsCode — just flagging the double dedup/sort in case you'd rather pick one layer to own it.

Sign up for freeto 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

@TooTallNate@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' perf(core): precompile workflow vm.Script at module init by TooTallNate · Pull Request #2524 · vercel/workflow · GitHub
Skip to content

perf(core): precompile workflow vm.Script at module init - #2524

Open
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init
Open

perf(core): precompile workflow vm.Script at module init#2524
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init

Conversation

@TooTallNate

Copy link
Copy Markdown
Member

Summary

  • Precompile the workflow bundle's vm.Script at module-init time (when workflowEntrypoint is constructed) instead of lazily on the first queue delivery's replay, so the first replay is a cache hit rather than paying the bundle parse/compile on the critical path.
  • workflowEntrypoint gains an optional workflowFilenames option; the builders inline the deduplicated, sorted set of workflow source filenames into generated routes so the precompiled Script matches exactly what runWorkflow compiles under (parseWorkflowName(name)?.moduleSpecifier || name).
  • When no filenames are provided, the bundle is still precompiled once under a representative filename to pay the bulk top-level parse early.

Details

  • packages/core/src/vm/script-cache.ts: add precompileWorkflowScripts() (swallows compile errors so module init never breaks) and an isWorkflowScriptCached() test inspector.
  • packages/core/src/runtime.ts: workflowEntrypoint(workflowCode, { namespace?, workflowFilenames? }) warms the compiled-bundle cache at construction time.
  • packages/builders: getWorkflowFilenamesFromManifest() derives the per-file source filenames from the manifest's workflowIds; wired into all generated-route sites (base-builder workflow-only / combined / combined-watch, builder-deferred watch / production) via createWorkflowEntrypointOptionsCode({ workflowFilenames }).

Verified end-to-end against the example workbench: the generated flow route emits workflowEntrypoint(workflowCode, { workflowFilenames: [...] }) with the deduplicated, sorted filenames.

Testing

  • New unit tests: precompileWorkflowScripts (cache warming, identical-to-lazy Script, empty list, swallows syntax errors), createWorkflowEntrypointOptionsCode (filenames dedup/sort/combine), getWorkflowFilenamesFromManifest, and a workflowEntrypoint module-init precompile assertion.
  • @workflow/core and @workflow/builders build clean; affected test files pass.

Changeset

  • @workflow/core: minor (new workflowFilenames option + module-init precompile)
  • @workflow/builders, @workflow/next: patch (route wiring)

Compile the workflow bundle's `vm.Script` for each known workflow source
filename when `workflowEntrypoint` is constructed (module-init time),
rather than lazily on the first queue delivery's replay. Builders inline
the deduplicated, sorted set of workflow filenames into generated routes
via the new `workflowFilenames` entrypoint option, so the first replay is
a cache hit instead of paying the bundle parse/compile on the critical
path.
@TooTallNate
TooTallNate requested review from a team and ijjk as code ownersJune 18, 2026 21:36
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1ffc078

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

This PR includes changesets to release 16 packages
NameType
@workflow/buildersPatch
@workflow/nextPatch
@workflow/coreMinor
@workflow/astroPatch
@workflow/cliPatch
@workflow/nestPatch
@workflow/nitroPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/vitestPatch
workflowMinor
@workflow/web-sharedPatch
@workflow/webPatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production144022301672
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total8190210809272

❌ Failed Tests

▲ Vercel Production (2 failed)

astro (1 failed):

  • distributedAbortController - manual abort triggers signal | wrun_01KVEBJBCKBY07V9DFPPPE04VN | 🔍 observability

nextjs-turbopack (1 failed):

  • cancelRun via CLI - cancelling a running workflow | wrun_01KVEBB1EZ7BG88HYXXJCCJTXY | 🔍 observability

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro124127
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
❌ nextjs-turbopack14813
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.042s (-4.1%)1.006s (~)0.965s101.00x
💻 LocalNitro0.042s (+2.7%)1.005s (~)0.964s101.00x
💻 LocalNext.js (Turbopack)0.045s (-31.7% 🟢)1.005s (~)0.960s101.08x
🐘 PostgresExpress0.059s (-18.9% 🟢)1.012s (~)0.953s101.42x
🐘 PostgresNext.js (Turbopack)0.065s (-7.4% 🟢)1.012s (~)0.947s101.56x
🐘 PostgresNitro0.065s (+3.7%)1.013s (~)0.947s101.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.451s (+19.6% 🔺)2.595s (+13.1% 🔺)2.144s101.00x
▲ VercelNext.js (Turbopack)0.478s (+64.4% 🔺)2.473s (+30.7% 🔺)1.994s101.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.092s (+0.6%)2.005s (~)0.914s101.00x
💻 LocalExpress1.093s (-0.8%)2.006s (~)0.914s101.00x
🐘 PostgresNitro1.097s (-2.1%)2.008s (~)0.911s101.00x
🐘 PostgresExpress1.102s (~)2.010s (~)0.907s101.01x
💻 LocalNext.js (Turbopack)1.108s (-3.5%)2.006s (~)0.897s101.01x
🐘 PostgresNext.js (Turbopack)1.135s (-0.5%)2.009s (~)0.874s101.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.703s (-12.0% 🟢)3.912s (+6.4% 🔺)2.209s101.00x
▲ VercelNext.js (Turbopack)2.352s (+33.3% 🔺)4.394s (+18.4% 🔺)2.042s101.38x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.497s (~)11.016s (~)0.519s31.00x
🐘 PostgresNitro10.525s (~)11.018s (~)0.492s31.00x
💻 LocalNitro10.527s (~)11.023s (~)0.496s31.00x
💻 LocalExpress10.540s (~)11.023s (~)0.483s31.00x
💻 LocalNext.js (Turbopack)10.606s (-1.8%)11.021s (~)0.415s31.01x
🐘 PostgresNext.js (Turbopack)10.796s (-0.6%)11.018s (~)0.222s31.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)14.860s (+3.8%)16.723s (+2.6%)1.863s21.00x
▲ VercelExpress15.777s (-12.7% 🟢)17.890s (-10.4% 🟢)2.113s21.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.680s (-1.2%)14.019s (~)0.338s51.00x
💻 LocalExpress13.737s (~)14.027s (~)0.290s51.00x
🐘 PostgresNitro13.778s (~)14.017s (~)0.239s51.01x
💻 LocalNitro13.794s (+1.2%)14.027s (~)0.233s51.01x
💻 LocalNext.js (Turbopack)13.945s (-2.9%)14.024s (-6.7% 🟢)0.079s51.02x
🐘 PostgresNext.js (Turbopack)14.479s (~)15.019s (~)0.540s41.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.786s (-32.9% 🟢)25.665s (-30.3% 🟢)1.879s31.00x
▲ VercelExpress28.078s (+15.9% 🔺)30.151s (+15.2% 🔺)2.073s21.18x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express12.277s (-1.3%)13.017s (~)0.739s71.00x
💻 LocalNitro12.293s (+1.8%)13.024s (+1.0%)0.732s71.00x
🐘 PostgresNitro12.332s (-1.5%)13.016s (~)0.685s71.00x
💻 LocalExpress12.377s (-1.4%)13.026s (~)0.649s71.01x
💻 LocalNext.js (Turbopack)12.996s (-4.8%)13.453s (-4.1%)0.457s71.06x
🐘 PostgresNext.js (Turbopack)13.672s (-1.4%)14.022s (-1.0%)0.350s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.089s (-11.3% 🟢)33.544s (-9.1% 🟢)2.455s31.00x
▲ VercelNext.js (Turbopack)32.851s (-6.7% 🟢)35.009s (-5.2% 🟢)2.158s31.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.184s (-2.4%)2.007s (~)0.823s151.00x
🐘 PostgresNitro1.188s (-0.9%)2.007s (~)0.818s151.00x
💻 LocalExpress1.218s (+4.5%)2.006s (~)0.788s151.03x
💻 LocalNitro1.221s (+4.4%)2.007s (~)0.786s151.03x
🐘 PostgresNext.js (Turbopack)1.254s (-2.5%)2.008s (~)0.754s151.06x
💻 LocalNext.js (Turbopack)1.314s (+1.4%)2.006s (~)0.692s151.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.610s (+62.7% 🔺)5.619s (+44.6% 🔺)2.008s61.00x
▲ VercelNext.js (Turbopack)4.317s (+61.9% 🔺)6.102s (+48.9% 🔺)1.785s51.20x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.280s (-6.2% 🟢)2.007s (-20.0% 🟢)0.728s151.00x
🐘 PostgresExpress1.345s (-5.6% 🟢)2.008s (-16.1% 🟢)0.663s151.05x
🐘 PostgresNext.js (Turbopack)1.420s (-13.3% 🟢)2.007s (-16.1% 🟢)0.588s151.11x
💻 LocalExpress2.080s (+27.9% 🔺)2.592s (+29.2% 🔺)0.512s121.63x
💻 LocalNitro2.114s (+36.2% 🔺)3.009s (+49.6% 🔺)0.895s101.65x
💻 LocalNext.js (Turbopack)2.244s (+17.5% 🔺)2.825s (+23.2% 🔺)0.581s111.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.282s (+8.1% 🔺)6.113s (+7.8% 🔺)1.831s51.00x
▲ VercelNext.js (Turbopack)5.293s (+17.9% 🔺)7.023s (+8.4% 🔺)1.730s51.24x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.454s (-17.5% 🟢)3.209s (-17.4% 🟢)1.755s101.00x
🐘 PostgresNitro1.514s (-5.1% 🟢)3.454s (-13.9% 🟢)1.940s91.04x
🐘 PostgresNext.js (Turbopack)2.397s (-24.1% 🟢)3.211s (-25.4% 🟢)0.813s101.65x
💻 LocalNext.js (Turbopack)4.863s (-15.8% 🟢)5.510s (-11.4% 🟢)0.648s63.34x
💻 LocalNitro5.437s (+58.8% 🔺)6.016s (+50.0% 🔺)0.579s53.74x
💻 LocalExpress5.607s (+28.3% 🔺)6.014s (+23.6% 🔺)0.406s63.86x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.175s (-6.0% 🟢)6.691s (-15.6% 🟢)1.516s51.00x
▲ VercelNext.js (Turbopack)5.635s (~)7.580s (-1.8%)1.945s41.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.188s (-2.4%)2.008s (~)0.820s151.00x
💻 LocalNitro1.233s (+2.7%)2.006s (~)0.773s151.04x
💻 LocalExpress1.234s (-21.7% 🟢)2.006s (~)0.772s151.04x
🐘 PostgresNext.js (Turbopack)1.252s (-2.2%)2.006s (~)0.754s151.05x
🐘 PostgresNitro1.255s (+3.6%)2.008s (~)0.753s151.06x
💻 LocalNext.js (Turbopack)1.356s (-3.1%)2.006s (~)0.650s151.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.577s (+54.0% 🔺)5.261s (+38.3% 🔺)1.684s61.00x
▲ VercelNext.js (Turbopack)3.682s (-1.0%)5.338s (+2.1%)1.656s61.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.288s (-5.7% 🟢)2.007s (-13.3% 🟢)0.720s151.00x
🐘 PostgresNitro1.304s (-9.6% 🟢)2.006s (-16.2% 🟢)0.702s151.01x
🐘 PostgresNext.js (Turbopack)1.421s (-7.9% 🟢)2.007s (-9.7% 🟢)0.586s151.10x
💻 LocalExpress2.015s (+6.2% 🔺)2.736s (+27.3% 🔺)0.720s111.57x
💻 LocalNitro2.098s (+23.9% 🔺)2.827s (+40.7% 🔺)0.728s111.63x
💻 LocalNext.js (Turbopack)2.189s (+0.9%)2.733s (-9.1% 🟢)0.545s111.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.608s (-19.2% 🟢)5.326s (-13.5% 🟢)1.718s61.00x
▲ VercelExpress3.823s (+40.3% 🔺)5.641s (+23.4% 🔺)1.818s61.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.434s (-20.5% 🟢)3.885s (-9.6% 🟢)2.451s81.00x
🐘 PostgresExpress1.505s (-16.4% 🟢)3.761s (-6.2% 🟢)2.256s81.05x
🐘 PostgresNext.js (Turbopack)2.441s (-40.0% 🟢)3.210s (-27.8% 🟢)0.769s101.70x
💻 LocalNext.js (Turbopack)5.325s (-8.3% 🟢)6.013s (-6.3% 🟢)0.688s53.71x
💻 LocalNitro5.552s (+23.6% 🔺)6.015s (+20.0% 🔺)0.463s63.87x
💻 LocalExpress5.867s (+27.8% 🔺)6.350s (+26.7% 🔺)0.483s64.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.865s (-42.3% 🟢)6.596s (-35.6% 🟢)1.731s51.00x
▲ VercelNext.js (Turbopack)6.204s (+64.0% 🔺)8.242s (+57.5% 🔺)2.038s41.28x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.528s (-11.1% 🟢)1.006s (-3.3%)0.478s601.00x
💻 LocalNitro0.563s (+12.6% 🔺)1.005s (~)0.442s601.07x
🐘 PostgresExpress0.572s (~)1.023s (+1.7%)0.450s591.08x
💻 LocalExpress0.606s (-3.0%)1.005s (-1.6%)0.399s601.15x
💻 LocalNext.js (Turbopack)0.701s (-21.0% 🟢)1.004s (-3.4%)0.303s601.33x
🐘 PostgresNext.js (Turbopack)0.785s (-6.1% 🟢)1.006s (-1.7%)0.221s601.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.871s (-22.8% 🟢)6.946s (-14.7% 🟢)2.074s91.00x
▲ VercelExpress5.110s (+12.4% 🔺)7.398s (+14.2% 🔺)2.287s91.05x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (-9.2% 🟢)2.052s (+1.1%)0.792s451.00x
🐘 PostgresExpress1.290s (-4.9%)2.030s (~)0.740s451.02x
💻 LocalNitro1.403s (+18.1% 🔺)2.006s (~)0.604s451.11x
💻 LocalExpress1.462s (-1.8%)2.006s (~)0.545s451.16x
💻 LocalNext.js (Turbopack)1.790s (-14.8% 🟢)2.005s (-33.3% 🟢)0.216s451.42x
🐘 PostgresNext.js (Turbopack)1.829s (-5.8% 🟢)2.030s (-2.2%)0.201s451.45x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.122s (-36.4% 🟢)13.375s (-30.2% 🟢)2.253s71.00x
▲ VercelNext.js (Turbopack)11.452s (-15.8% 🟢)13.422s (-12.4% 🟢)1.971s71.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.498s (-10.7% 🟢)3.033s (-4.2%)0.535s401.00x
🐘 PostgresExpress2.538s (-6.4% 🟢)3.033s (-2.5%)0.495s401.02x
💻 LocalNitro3.063s (+12.2% 🔺)3.626s (+12.5% 🔺)0.564s341.23x
💻 LocalExpress3.206s (~)4.009s (~)0.804s301.28x
🐘 PostgresNext.js (Turbopack)3.697s (-4.4%)4.009s (-1.6%)0.313s301.48x
💻 LocalNext.js (Turbopack)3.828s (-11.9% 🟢)4.146s (-17.2% 🟢)0.318s291.53x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.676s (-16.9% 🟢)24.156s (-13.8% 🟢)2.480s61.00x
▲ VercelNext.js (Turbopack)23.635s (-5.4% 🟢)25.770s (-3.8%)2.134s51.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.216s (-8.1% 🟢)1.006s (~)0.789s601.00x
🐘 PostgresExpress0.221s (-4.5%)1.006s (~)0.785s601.02x
🐘 PostgresNext.js (Turbopack)0.261s (-11.3% 🟢)1.006s (~)0.745s601.21x
💻 LocalNitro0.428s (+14.9% 🔺)1.005s (~)0.576s601.98x
💻 LocalExpress0.430s (-2.2%)1.005s (~)0.574s601.99x
💻 LocalNext.js (Turbopack)0.559s (-4.0%)1.004s (~)0.445s602.58x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.453s (+58.2% 🔺)4.282s (+49.3% 🔺)1.830s151.00x
▲ VercelNext.js (Turbopack)2.537s (+35.5% 🔺)4.323s (+11.2% 🔺)1.787s141.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.314s (-11.6% 🟢)1.006s (-3.3%)0.692s901.00x
🐘 PostgresNitro0.325s (-5.0%)1.017s (~)0.692s891.04x
🐘 PostgresNext.js (Turbopack)0.435s (-19.2% 🟢)1.006s (-10.0% 🟢)0.571s901.39x
💻 LocalNitro2.092s (+37.3% 🔺)2.537s (+17.9% 🔺)0.444s366.66x
💻 LocalExpress2.133s (+2.1%)2.581s (-2.8%)0.448s356.79x
💻 LocalNext.js (Turbopack)2.357s (+1.1%)3.010s (-2.1%)0.653s307.50x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.706s (-7.5% 🟢)4.760s (-0.8%)2.054s201.00x
▲ VercelNext.js (Turbopack)3.147s (+3.4%)4.862s (+1.5%)1.715s191.16x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.517s (-9.0% 🟢)1.059s (-14.1% 🟢)0.542s1141.00x
🐘 PostgresExpress0.517s (-9.1% 🟢)1.107s (-9.0% 🟢)0.590s1091.00x
🐘 PostgresNext.js (Turbopack)1.665s (-36.4% 🟢)2.403s (-30.8% 🟢)0.738s513.22x
💻 LocalNext.js (Turbopack)9.274s (-13.8% 🟢)10.192s (-11.9% 🟢)0.918s1217.94x
💻 LocalExpress10.126s (+21.9% 🔺)10.779s (+21.4% 🔺)0.653s1219.59x
💻 LocalNitro10.299s (+63.2% 🔺)10.945s (+62.3% 🔺)0.646s1219.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.010s (-26.6% 🟢)6.009s (-15.2% 🟢)1.998s201.00x
▲ VercelNext.js (Turbopack)5.104s (+5.4% 🔺)6.996s (+7.1% 🔺)1.892s181.27x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.157s (-1.8%)1.999s (~)0.001s (-18.2% 🟢)2.010s (~)0.853s101.00x
🐘 PostgresNitro1.164s (~)1.999s (~)0.001s (+20.0% 🔺)2.010s (~)0.847s101.01x
💻 LocalNitro1.167s (+4.4%)2.006s (~)0.012s (-55.4% 🟢)2.020s (-0.9%)0.853s101.01x
💻 LocalExpress1.170s (+1.7%)2.005s (~)0.012s (+20.8% 🔺)2.020s (~)0.850s101.01x
💻 LocalNext.js (Turbopack)1.184s (-2.2%)2.002s (~)0.008s (-36.0% 🟢)2.014s (~)0.830s101.02x
🐘 PostgresNext.js (Turbopack)1.217s (-1.0%)2.001s (~)0.001s (-30.8% 🟢)2.010s (~)0.793s101.05x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.670s (+5.9% 🔺)3.838s (~)4.711s (+483.4% 🔺)9.069s (+78.4% 🔺)6.399s101.00x
▲ VercelExpress2.901s (+20.8% 🔺)4.452s (+21.0% 🔺)4.320s (+483.0% 🔺)9.303s (+90.8% 🔺)6.401s101.09x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.552s (-2.0%)2.003s (~)0.005s (+11.4% 🔺)2.026s (~)0.474s301.00x
🐘 PostgresNitro1.566s (-0.8%)2.005s (~)0.005s (-9.9% 🟢)2.026s (~)0.460s301.01x
💻 LocalNitro1.568s (+9.1% 🔺)2.011s (~)0.014s (-24.0% 🟢)2.026s (~)0.458s301.01x
💻 LocalExpress1.588s (+1.4%)2.010s (~)0.011s (-13.7% 🟢)2.023s (~)0.435s301.02x
💻 LocalNext.js (Turbopack)1.614s (-7.8% 🟢)2.008s (~)0.012s (-5.7% 🟢)2.022s (~)0.408s301.04x
🐘 PostgresNext.js (Turbopack)1.755s (-1.7%)2.010s (~)0.005s (-0.6%)2.025s (~)0.269s301.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.320s (+30.3% 🔺)10.378s (+32.9% 🔺)0.371s (+107.3% 🔺)11.213s (+32.6% 🔺)2.892s61.00x
▲ VercelNext.js (Turbopack)8.347s (-1.7%)10.004s (+1.9%)0.488s (+85.4% 🔺)10.955s (+3.6%)2.608s61.00x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.737s (-4.7%)1.064s (+1.5%)0.000s (+96.4% 🔺)1.086s (-0.7%)0.349s561.00x
🐘 PostgresExpress0.754s (-1.3%)1.046s (+2.1%)0.000s (-50.0% 🟢)1.060s (~)0.306s571.02x
🐘 PostgresNext.js (Turbopack)0.916s (-10.2% 🟢)1.250s (-14.6% 🟢)0.000s (-57.3% 🟢)1.257s (-14.6% 🟢)0.341s481.24x
💻 LocalNext.js (Turbopack)1.433s (-5.3% 🟢)1.917s (-4.8%)0.000s (-37.5% 🟢)1.919s (-4.8%)0.486s321.95x
💻 LocalNitro1.451s (+34.9% 🔺)2.014s (+9.6% 🔺)0.000s (-52.9% 🟢)2.016s (+9.6% 🔺)0.566s301.97x
💻 LocalExpress1.572s (+15.4% 🔺)2.014s (~)0.000s (~)2.016s (~)0.444s302.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.647s (+34.8% 🔺)6.077s (+27.4% 🔺)0.000s (+20.0% 🔺)6.573s (+24.9% 🔺)1.926s101.00x
▲ VercelExpress5.355s (+76.7% 🔺)6.649s (+45.7% 🔺)0.000s (+Infinity% 🔺)7.225s (+43.4% 🔺)1.869s91.15x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.446s (-10.4% 🟢)2.100s (+1.8%)0.000s (NaN%)2.120s (+1.5%)0.674s291.00x
🐘 PostgresNitro1.601s (+3.2%)2.172s (+1.8%)0.000s (-100.0% 🟢)2.194s (+2.2%)0.593s281.11x
🐘 PostgresNext.js (Turbopack)2.201s (+4.3%)2.609s (+0.8%)0.000s (-100.0% 🟢)2.618s (+0.8%)0.417s231.52x
💻 LocalNext.js (Turbopack)3.608s (+24.4% 🔺)4.283s (+27.6% 🔺)0.001s (+126.7% 🔺)4.295s (+27.7% 🔺)0.688s152.49x
💻 LocalNitro3.665s (+66.1% 🔺)4.310s (+57.2% 🔺)0.001s (-10.2% 🟢)4.321s (+56.9% 🔺)0.656s142.53x
💻 LocalExpress4.419s (+50.8% 🔺)4.870s (+32.7% 🔺)0.000s (+4.6%)4.880s (+32.8% 🔺)0.461s133.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.466s (+13.6% 🔺)7.920s (+9.6% 🔺)0.000s (+Infinity% 🔺)8.414s (+9.4% 🔺)1.949s81.00x
▲ VercelNext.js (Turbopack)6.901s (-4.8%)8.409s (~)0.013s (+10071.4% 🔺)8.839s (~)1.938s71.07x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresExpress12/21
▲ VercelExpress15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres19/21
Next.js (Turbopack)🐘 Postgres12/21
Nitro🐘 Postgres17/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


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the full diff, built @workflow/core + @workflow/builders clean, and ran the affected tests (script-cache, runtime, constants, get-workflow-filenames) locally — all green.

The design is nicely fail-safe: workflowFilenames is best-effort, and a wrong/missing/extra filename only ever degrades to a cache miss → lazy compile (exactly today's behavior), with no determinism or correctness risk. The filename derivation also lines up with the runtime: since the registry lookup __private_workflows.get(workflowName) has to succeed, workflowName === workflowId, so the build-time moduleSpecifier matches what runWorkflow compiles under. Tests, comments, and the namespace-options refactor all look solid.

One tradeoff I'd like validated before merge (inline on runtime.ts), plus two smaller notes. Nothing blocking.

// (for stack-trace attribution); the builder passes that deduplicated set of
// filenames. When none are provided, fall back to a single representative
// filename so the bulk top-level parse is still done eagerly.
precompileWorkflowBundle(workflowCode, options?.workflowFilenames);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth validating against a multi-file benchmark. This eagerly compiles the full bundle once per workflow source file at module init — getCachedWorkflowScript does new Script(fullBundle, { filename }) per filename, and V8 keys its script compilation cache on the filename as well as the source, so there's no parse sharing across them (the existing script-cache.ts doc already notes "the whole bundle is compiled once per distinct filename").

The lazy path only ever compiled the filenames of workflows this process actually served. For an app with many workflow files where a given serverless instance only handles a subset, this front-loads — and increases total — cold-start parse work for workflows that may never run on this instance. The first-request win is real only if module init runs off that request's critical path on the platform; otherwise end-to-end latency for the first invocation could regress as the number of source files grows.

Does the benchmark cover an app with many distinct workflow source files (not just many functions in one file)? If not, that's the case I'd most want to see before merging.

* filename compiles the bulk of the bundle; the per-workflow filenames then
* recompile lazily (a cheap re-parse) on first replay.
*/
const PRECOMPILE_FALLBACK_FILENAME = '<workflow-bundle>';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fallback doesn't actually move any parse cost off the first replay. It caches a Script under <workflow-bundle>, but runWorkflow looks it up under the real moduleSpecifier, so the first replay still does a full new Script(...) under that real filename (different filename ⇒ full recompile, no reuse of the fallback entry). So the no-filenames path pays an extra full top-level parse at init for a Script that is never read, then parses again at replay — net overhead plus a dead cache entry, not a saving.

Since the builders now always pass workflowFilenames, this only affects manual/legacy callers, so it's low-impact. But consider either making the no-filenames case a no-op, or tightening the comment here and at lines 327-330 — both currently read as if the fallback warms the replay path, which it doesn't.

getQueueTopicPrefix('workflow', namespace);
const workflowFilenames = options?.workflowFilenames;
if (workflowFilenames && workflowFilenames.length > 0) {
const sorted = [...new Set(workflowFilenames)].sort();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor/nit: getWorkflowFilenamesFromManifest already returns a deduped, sorted array, so for the builder call sites this new Set(...).sort() is redundant work. It's harmless and reasonable as defensive normalization for direct callers of createWorkflowEntrypointOptionsCode — just flagging the double dedup/sort in case you'd rather pick one layer to own it.

Sign up for freeto 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

@TooTallNate@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' perf(core): precompile workflow vm.Script at module init by TooTallNate · Pull Request #2524 · vercel/workflow · GitHub
Skip to content

perf(core): precompile workflow vm.Script at module init - #2524

Open
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init
Open

perf(core): precompile workflow vm.Script at module init#2524
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init

Conversation

@TooTallNate

Copy link
Copy Markdown
Member

Summary

  • Precompile the workflow bundle's vm.Script at module-init time (when workflowEntrypoint is constructed) instead of lazily on the first queue delivery's replay, so the first replay is a cache hit rather than paying the bundle parse/compile on the critical path.
  • workflowEntrypoint gains an optional workflowFilenames option; the builders inline the deduplicated, sorted set of workflow source filenames into generated routes so the precompiled Script matches exactly what runWorkflow compiles under (parseWorkflowName(name)?.moduleSpecifier || name).
  • When no filenames are provided, the bundle is still precompiled once under a representative filename to pay the bulk top-level parse early.

Details

  • packages/core/src/vm/script-cache.ts: add precompileWorkflowScripts() (swallows compile errors so module init never breaks) and an isWorkflowScriptCached() test inspector.
  • packages/core/src/runtime.ts: workflowEntrypoint(workflowCode, { namespace?, workflowFilenames? }) warms the compiled-bundle cache at construction time.
  • packages/builders: getWorkflowFilenamesFromManifest() derives the per-file source filenames from the manifest's workflowIds; wired into all generated-route sites (base-builder workflow-only / combined / combined-watch, builder-deferred watch / production) via createWorkflowEntrypointOptionsCode({ workflowFilenames }).

Verified end-to-end against the example workbench: the generated flow route emits workflowEntrypoint(workflowCode, { workflowFilenames: [...] }) with the deduplicated, sorted filenames.

Testing

  • New unit tests: precompileWorkflowScripts (cache warming, identical-to-lazy Script, empty list, swallows syntax errors), createWorkflowEntrypointOptionsCode (filenames dedup/sort/combine), getWorkflowFilenamesFromManifest, and a workflowEntrypoint module-init precompile assertion.
  • @workflow/core and @workflow/builders build clean; affected test files pass.

Changeset

  • @workflow/core: minor (new workflowFilenames option + module-init precompile)
  • @workflow/builders, @workflow/next: patch (route wiring)

Compile the workflow bundle's `vm.Script` for each known workflow source
filename when `workflowEntrypoint` is constructed (module-init time),
rather than lazily on the first queue delivery's replay. Builders inline
the deduplicated, sorted set of workflow filenames into generated routes
via the new `workflowFilenames` entrypoint option, so the first replay is
a cache hit instead of paying the bundle parse/compile on the critical
path.
@TooTallNate
TooTallNate requested review from a team and ijjk as code ownersJune 18, 2026 21:36
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1ffc078

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

This PR includes changesets to release 16 packages
NameType
@workflow/buildersPatch
@workflow/nextPatch
@workflow/coreMinor
@workflow/astroPatch
@workflow/cliPatch
@workflow/nestPatch
@workflow/nitroPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/vitestPatch
workflowMinor
@workflow/web-sharedPatch
@workflow/webPatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production144022301672
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total8190210809272

❌ Failed Tests

▲ Vercel Production (2 failed)

astro (1 failed):

  • distributedAbortController - manual abort triggers signal | wrun_01KVEBJBCKBY07V9DFPPPE04VN | 🔍 observability

nextjs-turbopack (1 failed):

  • cancelRun via CLI - cancelling a running workflow | wrun_01KVEBB1EZ7BG88HYXXJCCJTXY | 🔍 observability

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro124127
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
❌ nextjs-turbopack14813
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.042s (-4.1%)1.006s (~)0.965s101.00x
💻 LocalNitro0.042s (+2.7%)1.005s (~)0.964s101.00x
💻 LocalNext.js (Turbopack)0.045s (-31.7% 🟢)1.005s (~)0.960s101.08x
🐘 PostgresExpress0.059s (-18.9% 🟢)1.012s (~)0.953s101.42x
🐘 PostgresNext.js (Turbopack)0.065s (-7.4% 🟢)1.012s (~)0.947s101.56x
🐘 PostgresNitro0.065s (+3.7%)1.013s (~)0.947s101.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.451s (+19.6% 🔺)2.595s (+13.1% 🔺)2.144s101.00x
▲ VercelNext.js (Turbopack)0.478s (+64.4% 🔺)2.473s (+30.7% 🔺)1.994s101.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.092s (+0.6%)2.005s (~)0.914s101.00x
💻 LocalExpress1.093s (-0.8%)2.006s (~)0.914s101.00x
🐘 PostgresNitro1.097s (-2.1%)2.008s (~)0.911s101.00x
🐘 PostgresExpress1.102s (~)2.010s (~)0.907s101.01x
💻 LocalNext.js (Turbopack)1.108s (-3.5%)2.006s (~)0.897s101.01x
🐘 PostgresNext.js (Turbopack)1.135s (-0.5%)2.009s (~)0.874s101.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.703s (-12.0% 🟢)3.912s (+6.4% 🔺)2.209s101.00x
▲ VercelNext.js (Turbopack)2.352s (+33.3% 🔺)4.394s (+18.4% 🔺)2.042s101.38x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.497s (~)11.016s (~)0.519s31.00x
🐘 PostgresNitro10.525s (~)11.018s (~)0.492s31.00x
💻 LocalNitro10.527s (~)11.023s (~)0.496s31.00x
💻 LocalExpress10.540s (~)11.023s (~)0.483s31.00x
💻 LocalNext.js (Turbopack)10.606s (-1.8%)11.021s (~)0.415s31.01x
🐘 PostgresNext.js (Turbopack)10.796s (-0.6%)11.018s (~)0.222s31.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)14.860s (+3.8%)16.723s (+2.6%)1.863s21.00x
▲ VercelExpress15.777s (-12.7% 🟢)17.890s (-10.4% 🟢)2.113s21.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.680s (-1.2%)14.019s (~)0.338s51.00x
💻 LocalExpress13.737s (~)14.027s (~)0.290s51.00x
🐘 PostgresNitro13.778s (~)14.017s (~)0.239s51.01x
💻 LocalNitro13.794s (+1.2%)14.027s (~)0.233s51.01x
💻 LocalNext.js (Turbopack)13.945s (-2.9%)14.024s (-6.7% 🟢)0.079s51.02x
🐘 PostgresNext.js (Turbopack)14.479s (~)15.019s (~)0.540s41.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.786s (-32.9% 🟢)25.665s (-30.3% 🟢)1.879s31.00x
▲ VercelExpress28.078s (+15.9% 🔺)30.151s (+15.2% 🔺)2.073s21.18x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express12.277s (-1.3%)13.017s (~)0.739s71.00x
💻 LocalNitro12.293s (+1.8%)13.024s (+1.0%)0.732s71.00x
🐘 PostgresNitro12.332s (-1.5%)13.016s (~)0.685s71.00x
💻 LocalExpress12.377s (-1.4%)13.026s (~)0.649s71.01x
💻 LocalNext.js (Turbopack)12.996s (-4.8%)13.453s (-4.1%)0.457s71.06x
🐘 PostgresNext.js (Turbopack)13.672s (-1.4%)14.022s (-1.0%)0.350s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.089s (-11.3% 🟢)33.544s (-9.1% 🟢)2.455s31.00x
▲ VercelNext.js (Turbopack)32.851s (-6.7% 🟢)35.009s (-5.2% 🟢)2.158s31.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.184s (-2.4%)2.007s (~)0.823s151.00x
🐘 PostgresNitro1.188s (-0.9%)2.007s (~)0.818s151.00x
💻 LocalExpress1.218s (+4.5%)2.006s (~)0.788s151.03x
💻 LocalNitro1.221s (+4.4%)2.007s (~)0.786s151.03x
🐘 PostgresNext.js (Turbopack)1.254s (-2.5%)2.008s (~)0.754s151.06x
💻 LocalNext.js (Turbopack)1.314s (+1.4%)2.006s (~)0.692s151.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.610s (+62.7% 🔺)5.619s (+44.6% 🔺)2.008s61.00x
▲ VercelNext.js (Turbopack)4.317s (+61.9% 🔺)6.102s (+48.9% 🔺)1.785s51.20x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.280s (-6.2% 🟢)2.007s (-20.0% 🟢)0.728s151.00x
🐘 PostgresExpress1.345s (-5.6% 🟢)2.008s (-16.1% 🟢)0.663s151.05x
🐘 PostgresNext.js (Turbopack)1.420s (-13.3% 🟢)2.007s (-16.1% 🟢)0.588s151.11x
💻 LocalExpress2.080s (+27.9% 🔺)2.592s (+29.2% 🔺)0.512s121.63x
💻 LocalNitro2.114s (+36.2% 🔺)3.009s (+49.6% 🔺)0.895s101.65x
💻 LocalNext.js (Turbopack)2.244s (+17.5% 🔺)2.825s (+23.2% 🔺)0.581s111.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.282s (+8.1% 🔺)6.113s (+7.8% 🔺)1.831s51.00x
▲ VercelNext.js (Turbopack)5.293s (+17.9% 🔺)7.023s (+8.4% 🔺)1.730s51.24x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.454s (-17.5% 🟢)3.209s (-17.4% 🟢)1.755s101.00x
🐘 PostgresNitro1.514s (-5.1% 🟢)3.454s (-13.9% 🟢)1.940s91.04x
🐘 PostgresNext.js (Turbopack)2.397s (-24.1% 🟢)3.211s (-25.4% 🟢)0.813s101.65x
💻 LocalNext.js (Turbopack)4.863s (-15.8% 🟢)5.510s (-11.4% 🟢)0.648s63.34x
💻 LocalNitro5.437s (+58.8% 🔺)6.016s (+50.0% 🔺)0.579s53.74x
💻 LocalExpress5.607s (+28.3% 🔺)6.014s (+23.6% 🔺)0.406s63.86x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.175s (-6.0% 🟢)6.691s (-15.6% 🟢)1.516s51.00x
▲ VercelNext.js (Turbopack)5.635s (~)7.580s (-1.8%)1.945s41.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.188s (-2.4%)2.008s (~)0.820s151.00x
💻 LocalNitro1.233s (+2.7%)2.006s (~)0.773s151.04x
💻 LocalExpress1.234s (-21.7% 🟢)2.006s (~)0.772s151.04x
🐘 PostgresNext.js (Turbopack)1.252s (-2.2%)2.006s (~)0.754s151.05x
🐘 PostgresNitro1.255s (+3.6%)2.008s (~)0.753s151.06x
💻 LocalNext.js (Turbopack)1.356s (-3.1%)2.006s (~)0.650s151.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.577s (+54.0% 🔺)5.261s (+38.3% 🔺)1.684s61.00x
▲ VercelNext.js (Turbopack)3.682s (-1.0%)5.338s (+2.1%)1.656s61.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.288s (-5.7% 🟢)2.007s (-13.3% 🟢)0.720s151.00x
🐘 PostgresNitro1.304s (-9.6% 🟢)2.006s (-16.2% 🟢)0.702s151.01x
🐘 PostgresNext.js (Turbopack)1.421s (-7.9% 🟢)2.007s (-9.7% 🟢)0.586s151.10x
💻 LocalExpress2.015s (+6.2% 🔺)2.736s (+27.3% 🔺)0.720s111.57x
💻 LocalNitro2.098s (+23.9% 🔺)2.827s (+40.7% 🔺)0.728s111.63x
💻 LocalNext.js (Turbopack)2.189s (+0.9%)2.733s (-9.1% 🟢)0.545s111.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.608s (-19.2% 🟢)5.326s (-13.5% 🟢)1.718s61.00x
▲ VercelExpress3.823s (+40.3% 🔺)5.641s (+23.4% 🔺)1.818s61.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.434s (-20.5% 🟢)3.885s (-9.6% 🟢)2.451s81.00x
🐘 PostgresExpress1.505s (-16.4% 🟢)3.761s (-6.2% 🟢)2.256s81.05x
🐘 PostgresNext.js (Turbopack)2.441s (-40.0% 🟢)3.210s (-27.8% 🟢)0.769s101.70x
💻 LocalNext.js (Turbopack)5.325s (-8.3% 🟢)6.013s (-6.3% 🟢)0.688s53.71x
💻 LocalNitro5.552s (+23.6% 🔺)6.015s (+20.0% 🔺)0.463s63.87x
💻 LocalExpress5.867s (+27.8% 🔺)6.350s (+26.7% 🔺)0.483s64.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.865s (-42.3% 🟢)6.596s (-35.6% 🟢)1.731s51.00x
▲ VercelNext.js (Turbopack)6.204s (+64.0% 🔺)8.242s (+57.5% 🔺)2.038s41.28x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.528s (-11.1% 🟢)1.006s (-3.3%)0.478s601.00x
💻 LocalNitro0.563s (+12.6% 🔺)1.005s (~)0.442s601.07x
🐘 PostgresExpress0.572s (~)1.023s (+1.7%)0.450s591.08x
💻 LocalExpress0.606s (-3.0%)1.005s (-1.6%)0.399s601.15x
💻 LocalNext.js (Turbopack)0.701s (-21.0% 🟢)1.004s (-3.4%)0.303s601.33x
🐘 PostgresNext.js (Turbopack)0.785s (-6.1% 🟢)1.006s (-1.7%)0.221s601.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.871s (-22.8% 🟢)6.946s (-14.7% 🟢)2.074s91.00x
▲ VercelExpress5.110s (+12.4% 🔺)7.398s (+14.2% 🔺)2.287s91.05x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (-9.2% 🟢)2.052s (+1.1%)0.792s451.00x
🐘 PostgresExpress1.290s (-4.9%)2.030s (~)0.740s451.02x
💻 LocalNitro1.403s (+18.1% 🔺)2.006s (~)0.604s451.11x
💻 LocalExpress1.462s (-1.8%)2.006s (~)0.545s451.16x
💻 LocalNext.js (Turbopack)1.790s (-14.8% 🟢)2.005s (-33.3% 🟢)0.216s451.42x
🐘 PostgresNext.js (Turbopack)1.829s (-5.8% 🟢)2.030s (-2.2%)0.201s451.45x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.122s (-36.4% 🟢)13.375s (-30.2% 🟢)2.253s71.00x
▲ VercelNext.js (Turbopack)11.452s (-15.8% 🟢)13.422s (-12.4% 🟢)1.971s71.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.498s (-10.7% 🟢)3.033s (-4.2%)0.535s401.00x
🐘 PostgresExpress2.538s (-6.4% 🟢)3.033s (-2.5%)0.495s401.02x
💻 LocalNitro3.063s (+12.2% 🔺)3.626s (+12.5% 🔺)0.564s341.23x
💻 LocalExpress3.206s (~)4.009s (~)0.804s301.28x
🐘 PostgresNext.js (Turbopack)3.697s (-4.4%)4.009s (-1.6%)0.313s301.48x
💻 LocalNext.js (Turbopack)3.828s (-11.9% 🟢)4.146s (-17.2% 🟢)0.318s291.53x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.676s (-16.9% 🟢)24.156s (-13.8% 🟢)2.480s61.00x
▲ VercelNext.js (Turbopack)23.635s (-5.4% 🟢)25.770s (-3.8%)2.134s51.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.216s (-8.1% 🟢)1.006s (~)0.789s601.00x
🐘 PostgresExpress0.221s (-4.5%)1.006s (~)0.785s601.02x
🐘 PostgresNext.js (Turbopack)0.261s (-11.3% 🟢)1.006s (~)0.745s601.21x
💻 LocalNitro0.428s (+14.9% 🔺)1.005s (~)0.576s601.98x
💻 LocalExpress0.430s (-2.2%)1.005s (~)0.574s601.99x
💻 LocalNext.js (Turbopack)0.559s (-4.0%)1.004s (~)0.445s602.58x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.453s (+58.2% 🔺)4.282s (+49.3% 🔺)1.830s151.00x
▲ VercelNext.js (Turbopack)2.537s (+35.5% 🔺)4.323s (+11.2% 🔺)1.787s141.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.314s (-11.6% 🟢)1.006s (-3.3%)0.692s901.00x
🐘 PostgresNitro0.325s (-5.0%)1.017s (~)0.692s891.04x
🐘 PostgresNext.js (Turbopack)0.435s (-19.2% 🟢)1.006s (-10.0% 🟢)0.571s901.39x
💻 LocalNitro2.092s (+37.3% 🔺)2.537s (+17.9% 🔺)0.444s366.66x
💻 LocalExpress2.133s (+2.1%)2.581s (-2.8%)0.448s356.79x
💻 LocalNext.js (Turbopack)2.357s (+1.1%)3.010s (-2.1%)0.653s307.50x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.706s (-7.5% 🟢)4.760s (-0.8%)2.054s201.00x
▲ VercelNext.js (Turbopack)3.147s (+3.4%)4.862s (+1.5%)1.715s191.16x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.517s (-9.0% 🟢)1.059s (-14.1% 🟢)0.542s1141.00x
🐘 PostgresExpress0.517s (-9.1% 🟢)1.107s (-9.0% 🟢)0.590s1091.00x
🐘 PostgresNext.js (Turbopack)1.665s (-36.4% 🟢)2.403s (-30.8% 🟢)0.738s513.22x
💻 LocalNext.js (Turbopack)9.274s (-13.8% 🟢)10.192s (-11.9% 🟢)0.918s1217.94x
💻 LocalExpress10.126s (+21.9% 🔺)10.779s (+21.4% 🔺)0.653s1219.59x
💻 LocalNitro10.299s (+63.2% 🔺)10.945s (+62.3% 🔺)0.646s1219.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.010s (-26.6% 🟢)6.009s (-15.2% 🟢)1.998s201.00x
▲ VercelNext.js (Turbopack)5.104s (+5.4% 🔺)6.996s (+7.1% 🔺)1.892s181.27x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.157s (-1.8%)1.999s (~)0.001s (-18.2% 🟢)2.010s (~)0.853s101.00x
🐘 PostgresNitro1.164s (~)1.999s (~)0.001s (+20.0% 🔺)2.010s (~)0.847s101.01x
💻 LocalNitro1.167s (+4.4%)2.006s (~)0.012s (-55.4% 🟢)2.020s (-0.9%)0.853s101.01x
💻 LocalExpress1.170s (+1.7%)2.005s (~)0.012s (+20.8% 🔺)2.020s (~)0.850s101.01x
💻 LocalNext.js (Turbopack)1.184s (-2.2%)2.002s (~)0.008s (-36.0% 🟢)2.014s (~)0.830s101.02x
🐘 PostgresNext.js (Turbopack)1.217s (-1.0%)2.001s (~)0.001s (-30.8% 🟢)2.010s (~)0.793s101.05x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.670s (+5.9% 🔺)3.838s (~)4.711s (+483.4% 🔺)9.069s (+78.4% 🔺)6.399s101.00x
▲ VercelExpress2.901s (+20.8% 🔺)4.452s (+21.0% 🔺)4.320s (+483.0% 🔺)9.303s (+90.8% 🔺)6.401s101.09x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.552s (-2.0%)2.003s (~)0.005s (+11.4% 🔺)2.026s (~)0.474s301.00x
🐘 PostgresNitro1.566s (-0.8%)2.005s (~)0.005s (-9.9% 🟢)2.026s (~)0.460s301.01x
💻 LocalNitro1.568s (+9.1% 🔺)2.011s (~)0.014s (-24.0% 🟢)2.026s (~)0.458s301.01x
💻 LocalExpress1.588s (+1.4%)2.010s (~)0.011s (-13.7% 🟢)2.023s (~)0.435s301.02x
💻 LocalNext.js (Turbopack)1.614s (-7.8% 🟢)2.008s (~)0.012s (-5.7% 🟢)2.022s (~)0.408s301.04x
🐘 PostgresNext.js (Turbopack)1.755s (-1.7%)2.010s (~)0.005s (-0.6%)2.025s (~)0.269s301.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.320s (+30.3% 🔺)10.378s (+32.9% 🔺)0.371s (+107.3% 🔺)11.213s (+32.6% 🔺)2.892s61.00x
▲ VercelNext.js (Turbopack)8.347s (-1.7%)10.004s (+1.9%)0.488s (+85.4% 🔺)10.955s (+3.6%)2.608s61.00x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.737s (-4.7%)1.064s (+1.5%)0.000s (+96.4% 🔺)1.086s (-0.7%)0.349s561.00x
🐘 PostgresExpress0.754s (-1.3%)1.046s (+2.1%)0.000s (-50.0% 🟢)1.060s (~)0.306s571.02x
🐘 PostgresNext.js (Turbopack)0.916s (-10.2% 🟢)1.250s (-14.6% 🟢)0.000s (-57.3% 🟢)1.257s (-14.6% 🟢)0.341s481.24x
💻 LocalNext.js (Turbopack)1.433s (-5.3% 🟢)1.917s (-4.8%)0.000s (-37.5% 🟢)1.919s (-4.8%)0.486s321.95x
💻 LocalNitro1.451s (+34.9% 🔺)2.014s (+9.6% 🔺)0.000s (-52.9% 🟢)2.016s (+9.6% 🔺)0.566s301.97x
💻 LocalExpress1.572s (+15.4% 🔺)2.014s (~)0.000s (~)2.016s (~)0.444s302.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.647s (+34.8% 🔺)6.077s (+27.4% 🔺)0.000s (+20.0% 🔺)6.573s (+24.9% 🔺)1.926s101.00x
▲ VercelExpress5.355s (+76.7% 🔺)6.649s (+45.7% 🔺)0.000s (+Infinity% 🔺)7.225s (+43.4% 🔺)1.869s91.15x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.446s (-10.4% 🟢)2.100s (+1.8%)0.000s (NaN%)2.120s (+1.5%)0.674s291.00x
🐘 PostgresNitro1.601s (+3.2%)2.172s (+1.8%)0.000s (-100.0% 🟢)2.194s (+2.2%)0.593s281.11x
🐘 PostgresNext.js (Turbopack)2.201s (+4.3%)2.609s (+0.8%)0.000s (-100.0% 🟢)2.618s (+0.8%)0.417s231.52x
💻 LocalNext.js (Turbopack)3.608s (+24.4% 🔺)4.283s (+27.6% 🔺)0.001s (+126.7% 🔺)4.295s (+27.7% 🔺)0.688s152.49x
💻 LocalNitro3.665s (+66.1% 🔺)4.310s (+57.2% 🔺)0.001s (-10.2% 🟢)4.321s (+56.9% 🔺)0.656s142.53x
💻 LocalExpress4.419s (+50.8% 🔺)4.870s (+32.7% 🔺)0.000s (+4.6%)4.880s (+32.8% 🔺)0.461s133.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.466s (+13.6% 🔺)7.920s (+9.6% 🔺)0.000s (+Infinity% 🔺)8.414s (+9.4% 🔺)1.949s81.00x
▲ VercelNext.js (Turbopack)6.901s (-4.8%)8.409s (~)0.013s (+10071.4% 🔺)8.839s (~)1.938s71.07x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresExpress12/21
▲ VercelExpress15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres19/21
Next.js (Turbopack)🐘 Postgres12/21
Nitro🐘 Postgres17/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


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the full diff, built @workflow/core + @workflow/builders clean, and ran the affected tests (script-cache, runtime, constants, get-workflow-filenames) locally — all green.

The design is nicely fail-safe: workflowFilenames is best-effort, and a wrong/missing/extra filename only ever degrades to a cache miss → lazy compile (exactly today's behavior), with no determinism or correctness risk. The filename derivation also lines up with the runtime: since the registry lookup __private_workflows.get(workflowName) has to succeed, workflowName === workflowId, so the build-time moduleSpecifier matches what runWorkflow compiles under. Tests, comments, and the namespace-options refactor all look solid.

One tradeoff I'd like validated before merge (inline on runtime.ts), plus two smaller notes. Nothing blocking.

// (for stack-trace attribution); the builder passes that deduplicated set of
// filenames. When none are provided, fall back to a single representative
// filename so the bulk top-level parse is still done eagerly.
precompileWorkflowBundle(workflowCode, options?.workflowFilenames);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth validating against a multi-file benchmark. This eagerly compiles the full bundle once per workflow source file at module init — getCachedWorkflowScript does new Script(fullBundle, { filename }) per filename, and V8 keys its script compilation cache on the filename as well as the source, so there's no parse sharing across them (the existing script-cache.ts doc already notes "the whole bundle is compiled once per distinct filename").

The lazy path only ever compiled the filenames of workflows this process actually served. For an app with many workflow files where a given serverless instance only handles a subset, this front-loads — and increases total — cold-start parse work for workflows that may never run on this instance. The first-request win is real only if module init runs off that request's critical path on the platform; otherwise end-to-end latency for the first invocation could regress as the number of source files grows.

Does the benchmark cover an app with many distinct workflow source files (not just many functions in one file)? If not, that's the case I'd most want to see before merging.

* filename compiles the bulk of the bundle; the per-workflow filenames then
* recompile lazily (a cheap re-parse) on first replay.
*/
const PRECOMPILE_FALLBACK_FILENAME = '<workflow-bundle>';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fallback doesn't actually move any parse cost off the first replay. It caches a Script under <workflow-bundle>, but runWorkflow looks it up under the real moduleSpecifier, so the first replay still does a full new Script(...) under that real filename (different filename ⇒ full recompile, no reuse of the fallback entry). So the no-filenames path pays an extra full top-level parse at init for a Script that is never read, then parses again at replay — net overhead plus a dead cache entry, not a saving.

Since the builders now always pass workflowFilenames, this only affects manual/legacy callers, so it's low-impact. But consider either making the no-filenames case a no-op, or tightening the comment here and at lines 327-330 — both currently read as if the fallback warms the replay path, which it doesn't.

getQueueTopicPrefix('workflow', namespace);
const workflowFilenames = options?.workflowFilenames;
if (workflowFilenames && workflowFilenames.length > 0) {
const sorted = [...new Set(workflowFilenames)].sort();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor/nit: getWorkflowFilenamesFromManifest already returns a deduped, sorted array, so for the builder call sites this new Set(...).sort() is redundant work. It's harmless and reasonable as defensive normalization for direct callers of createWorkflowEntrypointOptionsCode — just flagging the double dedup/sort in case you'd rather pick one layer to own it.

Sign up for freeto 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

@TooTallNate@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' perf(core): precompile workflow vm.Script at module init by TooTallNate · Pull Request #2524 · vercel/workflow · GitHub
Skip to content

perf(core): precompile workflow vm.Script at module init - #2524

Open
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init
Open

perf(core): precompile workflow vm.Script at module init#2524
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init

Conversation

@TooTallNate

Copy link
Copy Markdown
Member

Summary

  • Precompile the workflow bundle's vm.Script at module-init time (when workflowEntrypoint is constructed) instead of lazily on the first queue delivery's replay, so the first replay is a cache hit rather than paying the bundle parse/compile on the critical path.
  • workflowEntrypoint gains an optional workflowFilenames option; the builders inline the deduplicated, sorted set of workflow source filenames into generated routes so the precompiled Script matches exactly what runWorkflow compiles under (parseWorkflowName(name)?.moduleSpecifier || name).
  • When no filenames are provided, the bundle is still precompiled once under a representative filename to pay the bulk top-level parse early.

Details

  • packages/core/src/vm/script-cache.ts: add precompileWorkflowScripts() (swallows compile errors so module init never breaks) and an isWorkflowScriptCached() test inspector.
  • packages/core/src/runtime.ts: workflowEntrypoint(workflowCode, { namespace?, workflowFilenames? }) warms the compiled-bundle cache at construction time.
  • packages/builders: getWorkflowFilenamesFromManifest() derives the per-file source filenames from the manifest's workflowIds; wired into all generated-route sites (base-builder workflow-only / combined / combined-watch, builder-deferred watch / production) via createWorkflowEntrypointOptionsCode({ workflowFilenames }).

Verified end-to-end against the example workbench: the generated flow route emits workflowEntrypoint(workflowCode, { workflowFilenames: [...] }) with the deduplicated, sorted filenames.

Testing

  • New unit tests: precompileWorkflowScripts (cache warming, identical-to-lazy Script, empty list, swallows syntax errors), createWorkflowEntrypointOptionsCode (filenames dedup/sort/combine), getWorkflowFilenamesFromManifest, and a workflowEntrypoint module-init precompile assertion.
  • @workflow/core and @workflow/builders build clean; affected test files pass.

Changeset

  • @workflow/core: minor (new workflowFilenames option + module-init precompile)
  • @workflow/builders, @workflow/next: patch (route wiring)

Compile the workflow bundle's `vm.Script` for each known workflow source
filename when `workflowEntrypoint` is constructed (module-init time),
rather than lazily on the first queue delivery's replay. Builders inline
the deduplicated, sorted set of workflow filenames into generated routes
via the new `workflowFilenames` entrypoint option, so the first replay is
a cache hit instead of paying the bundle parse/compile on the critical
path.
@TooTallNate
TooTallNate requested review from a team and ijjk as code ownersJune 18, 2026 21:36
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1ffc078

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

This PR includes changesets to release 16 packages
NameType
@workflow/buildersPatch
@workflow/nextPatch
@workflow/coreMinor
@workflow/astroPatch
@workflow/cliPatch
@workflow/nestPatch
@workflow/nitroPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/vitestPatch
workflowMinor
@workflow/web-sharedPatch
@workflow/webPatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production144022301672
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total8190210809272

❌ Failed Tests

▲ Vercel Production (2 failed)

astro (1 failed):

  • distributedAbortController - manual abort triggers signal | wrun_01KVEBJBCKBY07V9DFPPPE04VN | 🔍 observability

nextjs-turbopack (1 failed):

  • cancelRun via CLI - cancelling a running workflow | wrun_01KVEBB1EZ7BG88HYXXJCCJTXY | 🔍 observability

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro124127
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
❌ nextjs-turbopack14813
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.042s (-4.1%)1.006s (~)0.965s101.00x
💻 LocalNitro0.042s (+2.7%)1.005s (~)0.964s101.00x
💻 LocalNext.js (Turbopack)0.045s (-31.7% 🟢)1.005s (~)0.960s101.08x
🐘 PostgresExpress0.059s (-18.9% 🟢)1.012s (~)0.953s101.42x
🐘 PostgresNext.js (Turbopack)0.065s (-7.4% 🟢)1.012s (~)0.947s101.56x
🐘 PostgresNitro0.065s (+3.7%)1.013s (~)0.947s101.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.451s (+19.6% 🔺)2.595s (+13.1% 🔺)2.144s101.00x
▲ VercelNext.js (Turbopack)0.478s (+64.4% 🔺)2.473s (+30.7% 🔺)1.994s101.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.092s (+0.6%)2.005s (~)0.914s101.00x
💻 LocalExpress1.093s (-0.8%)2.006s (~)0.914s101.00x
🐘 PostgresNitro1.097s (-2.1%)2.008s (~)0.911s101.00x
🐘 PostgresExpress1.102s (~)2.010s (~)0.907s101.01x
💻 LocalNext.js (Turbopack)1.108s (-3.5%)2.006s (~)0.897s101.01x
🐘 PostgresNext.js (Turbopack)1.135s (-0.5%)2.009s (~)0.874s101.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.703s (-12.0% 🟢)3.912s (+6.4% 🔺)2.209s101.00x
▲ VercelNext.js (Turbopack)2.352s (+33.3% 🔺)4.394s (+18.4% 🔺)2.042s101.38x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.497s (~)11.016s (~)0.519s31.00x
🐘 PostgresNitro10.525s (~)11.018s (~)0.492s31.00x
💻 LocalNitro10.527s (~)11.023s (~)0.496s31.00x
💻 LocalExpress10.540s (~)11.023s (~)0.483s31.00x
💻 LocalNext.js (Turbopack)10.606s (-1.8%)11.021s (~)0.415s31.01x
🐘 PostgresNext.js (Turbopack)10.796s (-0.6%)11.018s (~)0.222s31.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)14.860s (+3.8%)16.723s (+2.6%)1.863s21.00x
▲ VercelExpress15.777s (-12.7% 🟢)17.890s (-10.4% 🟢)2.113s21.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.680s (-1.2%)14.019s (~)0.338s51.00x
💻 LocalExpress13.737s (~)14.027s (~)0.290s51.00x
🐘 PostgresNitro13.778s (~)14.017s (~)0.239s51.01x
💻 LocalNitro13.794s (+1.2%)14.027s (~)0.233s51.01x
💻 LocalNext.js (Turbopack)13.945s (-2.9%)14.024s (-6.7% 🟢)0.079s51.02x
🐘 PostgresNext.js (Turbopack)14.479s (~)15.019s (~)0.540s41.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.786s (-32.9% 🟢)25.665s (-30.3% 🟢)1.879s31.00x
▲ VercelExpress28.078s (+15.9% 🔺)30.151s (+15.2% 🔺)2.073s21.18x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express12.277s (-1.3%)13.017s (~)0.739s71.00x
💻 LocalNitro12.293s (+1.8%)13.024s (+1.0%)0.732s71.00x
🐘 PostgresNitro12.332s (-1.5%)13.016s (~)0.685s71.00x
💻 LocalExpress12.377s (-1.4%)13.026s (~)0.649s71.01x
💻 LocalNext.js (Turbopack)12.996s (-4.8%)13.453s (-4.1%)0.457s71.06x
🐘 PostgresNext.js (Turbopack)13.672s (-1.4%)14.022s (-1.0%)0.350s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.089s (-11.3% 🟢)33.544s (-9.1% 🟢)2.455s31.00x
▲ VercelNext.js (Turbopack)32.851s (-6.7% 🟢)35.009s (-5.2% 🟢)2.158s31.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.184s (-2.4%)2.007s (~)0.823s151.00x
🐘 PostgresNitro1.188s (-0.9%)2.007s (~)0.818s151.00x
💻 LocalExpress1.218s (+4.5%)2.006s (~)0.788s151.03x
💻 LocalNitro1.221s (+4.4%)2.007s (~)0.786s151.03x
🐘 PostgresNext.js (Turbopack)1.254s (-2.5%)2.008s (~)0.754s151.06x
💻 LocalNext.js (Turbopack)1.314s (+1.4%)2.006s (~)0.692s151.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.610s (+62.7% 🔺)5.619s (+44.6% 🔺)2.008s61.00x
▲ VercelNext.js (Turbopack)4.317s (+61.9% 🔺)6.102s (+48.9% 🔺)1.785s51.20x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.280s (-6.2% 🟢)2.007s (-20.0% 🟢)0.728s151.00x
🐘 PostgresExpress1.345s (-5.6% 🟢)2.008s (-16.1% 🟢)0.663s151.05x
🐘 PostgresNext.js (Turbopack)1.420s (-13.3% 🟢)2.007s (-16.1% 🟢)0.588s151.11x
💻 LocalExpress2.080s (+27.9% 🔺)2.592s (+29.2% 🔺)0.512s121.63x
💻 LocalNitro2.114s (+36.2% 🔺)3.009s (+49.6% 🔺)0.895s101.65x
💻 LocalNext.js (Turbopack)2.244s (+17.5% 🔺)2.825s (+23.2% 🔺)0.581s111.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.282s (+8.1% 🔺)6.113s (+7.8% 🔺)1.831s51.00x
▲ VercelNext.js (Turbopack)5.293s (+17.9% 🔺)7.023s (+8.4% 🔺)1.730s51.24x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.454s (-17.5% 🟢)3.209s (-17.4% 🟢)1.755s101.00x
🐘 PostgresNitro1.514s (-5.1% 🟢)3.454s (-13.9% 🟢)1.940s91.04x
🐘 PostgresNext.js (Turbopack)2.397s (-24.1% 🟢)3.211s (-25.4% 🟢)0.813s101.65x
💻 LocalNext.js (Turbopack)4.863s (-15.8% 🟢)5.510s (-11.4% 🟢)0.648s63.34x
💻 LocalNitro5.437s (+58.8% 🔺)6.016s (+50.0% 🔺)0.579s53.74x
💻 LocalExpress5.607s (+28.3% 🔺)6.014s (+23.6% 🔺)0.406s63.86x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.175s (-6.0% 🟢)6.691s (-15.6% 🟢)1.516s51.00x
▲ VercelNext.js (Turbopack)5.635s (~)7.580s (-1.8%)1.945s41.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.188s (-2.4%)2.008s (~)0.820s151.00x
💻 LocalNitro1.233s (+2.7%)2.006s (~)0.773s151.04x
💻 LocalExpress1.234s (-21.7% 🟢)2.006s (~)0.772s151.04x
🐘 PostgresNext.js (Turbopack)1.252s (-2.2%)2.006s (~)0.754s151.05x
🐘 PostgresNitro1.255s (+3.6%)2.008s (~)0.753s151.06x
💻 LocalNext.js (Turbopack)1.356s (-3.1%)2.006s (~)0.650s151.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.577s (+54.0% 🔺)5.261s (+38.3% 🔺)1.684s61.00x
▲ VercelNext.js (Turbopack)3.682s (-1.0%)5.338s (+2.1%)1.656s61.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.288s (-5.7% 🟢)2.007s (-13.3% 🟢)0.720s151.00x
🐘 PostgresNitro1.304s (-9.6% 🟢)2.006s (-16.2% 🟢)0.702s151.01x
🐘 PostgresNext.js (Turbopack)1.421s (-7.9% 🟢)2.007s (-9.7% 🟢)0.586s151.10x
💻 LocalExpress2.015s (+6.2% 🔺)2.736s (+27.3% 🔺)0.720s111.57x
💻 LocalNitro2.098s (+23.9% 🔺)2.827s (+40.7% 🔺)0.728s111.63x
💻 LocalNext.js (Turbopack)2.189s (+0.9%)2.733s (-9.1% 🟢)0.545s111.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.608s (-19.2% 🟢)5.326s (-13.5% 🟢)1.718s61.00x
▲ VercelExpress3.823s (+40.3% 🔺)5.641s (+23.4% 🔺)1.818s61.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.434s (-20.5% 🟢)3.885s (-9.6% 🟢)2.451s81.00x
🐘 PostgresExpress1.505s (-16.4% 🟢)3.761s (-6.2% 🟢)2.256s81.05x
🐘 PostgresNext.js (Turbopack)2.441s (-40.0% 🟢)3.210s (-27.8% 🟢)0.769s101.70x
💻 LocalNext.js (Turbopack)5.325s (-8.3% 🟢)6.013s (-6.3% 🟢)0.688s53.71x
💻 LocalNitro5.552s (+23.6% 🔺)6.015s (+20.0% 🔺)0.463s63.87x
💻 LocalExpress5.867s (+27.8% 🔺)6.350s (+26.7% 🔺)0.483s64.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.865s (-42.3% 🟢)6.596s (-35.6% 🟢)1.731s51.00x
▲ VercelNext.js (Turbopack)6.204s (+64.0% 🔺)8.242s (+57.5% 🔺)2.038s41.28x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.528s (-11.1% 🟢)1.006s (-3.3%)0.478s601.00x
💻 LocalNitro0.563s (+12.6% 🔺)1.005s (~)0.442s601.07x
🐘 PostgresExpress0.572s (~)1.023s (+1.7%)0.450s591.08x
💻 LocalExpress0.606s (-3.0%)1.005s (-1.6%)0.399s601.15x
💻 LocalNext.js (Turbopack)0.701s (-21.0% 🟢)1.004s (-3.4%)0.303s601.33x
🐘 PostgresNext.js (Turbopack)0.785s (-6.1% 🟢)1.006s (-1.7%)0.221s601.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.871s (-22.8% 🟢)6.946s (-14.7% 🟢)2.074s91.00x
▲ VercelExpress5.110s (+12.4% 🔺)7.398s (+14.2% 🔺)2.287s91.05x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (-9.2% 🟢)2.052s (+1.1%)0.792s451.00x
🐘 PostgresExpress1.290s (-4.9%)2.030s (~)0.740s451.02x
💻 LocalNitro1.403s (+18.1% 🔺)2.006s (~)0.604s451.11x
💻 LocalExpress1.462s (-1.8%)2.006s (~)0.545s451.16x
💻 LocalNext.js (Turbopack)1.790s (-14.8% 🟢)2.005s (-33.3% 🟢)0.216s451.42x
🐘 PostgresNext.js (Turbopack)1.829s (-5.8% 🟢)2.030s (-2.2%)0.201s451.45x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.122s (-36.4% 🟢)13.375s (-30.2% 🟢)2.253s71.00x
▲ VercelNext.js (Turbopack)11.452s (-15.8% 🟢)13.422s (-12.4% 🟢)1.971s71.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.498s (-10.7% 🟢)3.033s (-4.2%)0.535s401.00x
🐘 PostgresExpress2.538s (-6.4% 🟢)3.033s (-2.5%)0.495s401.02x
💻 LocalNitro3.063s (+12.2% 🔺)3.626s (+12.5% 🔺)0.564s341.23x
💻 LocalExpress3.206s (~)4.009s (~)0.804s301.28x
🐘 PostgresNext.js (Turbopack)3.697s (-4.4%)4.009s (-1.6%)0.313s301.48x
💻 LocalNext.js (Turbopack)3.828s (-11.9% 🟢)4.146s (-17.2% 🟢)0.318s291.53x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.676s (-16.9% 🟢)24.156s (-13.8% 🟢)2.480s61.00x
▲ VercelNext.js (Turbopack)23.635s (-5.4% 🟢)25.770s (-3.8%)2.134s51.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.216s (-8.1% 🟢)1.006s (~)0.789s601.00x
🐘 PostgresExpress0.221s (-4.5%)1.006s (~)0.785s601.02x
🐘 PostgresNext.js (Turbopack)0.261s (-11.3% 🟢)1.006s (~)0.745s601.21x
💻 LocalNitro0.428s (+14.9% 🔺)1.005s (~)0.576s601.98x
💻 LocalExpress0.430s (-2.2%)1.005s (~)0.574s601.99x
💻 LocalNext.js (Turbopack)0.559s (-4.0%)1.004s (~)0.445s602.58x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.453s (+58.2% 🔺)4.282s (+49.3% 🔺)1.830s151.00x
▲ VercelNext.js (Turbopack)2.537s (+35.5% 🔺)4.323s (+11.2% 🔺)1.787s141.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.314s (-11.6% 🟢)1.006s (-3.3%)0.692s901.00x
🐘 PostgresNitro0.325s (-5.0%)1.017s (~)0.692s891.04x
🐘 PostgresNext.js (Turbopack)0.435s (-19.2% 🟢)1.006s (-10.0% 🟢)0.571s901.39x
💻 LocalNitro2.092s (+37.3% 🔺)2.537s (+17.9% 🔺)0.444s366.66x
💻 LocalExpress2.133s (+2.1%)2.581s (-2.8%)0.448s356.79x
💻 LocalNext.js (Turbopack)2.357s (+1.1%)3.010s (-2.1%)0.653s307.50x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.706s (-7.5% 🟢)4.760s (-0.8%)2.054s201.00x
▲ VercelNext.js (Turbopack)3.147s (+3.4%)4.862s (+1.5%)1.715s191.16x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.517s (-9.0% 🟢)1.059s (-14.1% 🟢)0.542s1141.00x
🐘 PostgresExpress0.517s (-9.1% 🟢)1.107s (-9.0% 🟢)0.590s1091.00x
🐘 PostgresNext.js (Turbopack)1.665s (-36.4% 🟢)2.403s (-30.8% 🟢)0.738s513.22x
💻 LocalNext.js (Turbopack)9.274s (-13.8% 🟢)10.192s (-11.9% 🟢)0.918s1217.94x
💻 LocalExpress10.126s (+21.9% 🔺)10.779s (+21.4% 🔺)0.653s1219.59x
💻 LocalNitro10.299s (+63.2% 🔺)10.945s (+62.3% 🔺)0.646s1219.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.010s (-26.6% 🟢)6.009s (-15.2% 🟢)1.998s201.00x
▲ VercelNext.js (Turbopack)5.104s (+5.4% 🔺)6.996s (+7.1% 🔺)1.892s181.27x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.157s (-1.8%)1.999s (~)0.001s (-18.2% 🟢)2.010s (~)0.853s101.00x
🐘 PostgresNitro1.164s (~)1.999s (~)0.001s (+20.0% 🔺)2.010s (~)0.847s101.01x
💻 LocalNitro1.167s (+4.4%)2.006s (~)0.012s (-55.4% 🟢)2.020s (-0.9%)0.853s101.01x
💻 LocalExpress1.170s (+1.7%)2.005s (~)0.012s (+20.8% 🔺)2.020s (~)0.850s101.01x
💻 LocalNext.js (Turbopack)1.184s (-2.2%)2.002s (~)0.008s (-36.0% 🟢)2.014s (~)0.830s101.02x
🐘 PostgresNext.js (Turbopack)1.217s (-1.0%)2.001s (~)0.001s (-30.8% 🟢)2.010s (~)0.793s101.05x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.670s (+5.9% 🔺)3.838s (~)4.711s (+483.4% 🔺)9.069s (+78.4% 🔺)6.399s101.00x
▲ VercelExpress2.901s (+20.8% 🔺)4.452s (+21.0% 🔺)4.320s (+483.0% 🔺)9.303s (+90.8% 🔺)6.401s101.09x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.552s (-2.0%)2.003s (~)0.005s (+11.4% 🔺)2.026s (~)0.474s301.00x
🐘 PostgresNitro1.566s (-0.8%)2.005s (~)0.005s (-9.9% 🟢)2.026s (~)0.460s301.01x
💻 LocalNitro1.568s (+9.1% 🔺)2.011s (~)0.014s (-24.0% 🟢)2.026s (~)0.458s301.01x
💻 LocalExpress1.588s (+1.4%)2.010s (~)0.011s (-13.7% 🟢)2.023s (~)0.435s301.02x
💻 LocalNext.js (Turbopack)1.614s (-7.8% 🟢)2.008s (~)0.012s (-5.7% 🟢)2.022s (~)0.408s301.04x
🐘 PostgresNext.js (Turbopack)1.755s (-1.7%)2.010s (~)0.005s (-0.6%)2.025s (~)0.269s301.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.320s (+30.3% 🔺)10.378s (+32.9% 🔺)0.371s (+107.3% 🔺)11.213s (+32.6% 🔺)2.892s61.00x
▲ VercelNext.js (Turbopack)8.347s (-1.7%)10.004s (+1.9%)0.488s (+85.4% 🔺)10.955s (+3.6%)2.608s61.00x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.737s (-4.7%)1.064s (+1.5%)0.000s (+96.4% 🔺)1.086s (-0.7%)0.349s561.00x
🐘 PostgresExpress0.754s (-1.3%)1.046s (+2.1%)0.000s (-50.0% 🟢)1.060s (~)0.306s571.02x
🐘 PostgresNext.js (Turbopack)0.916s (-10.2% 🟢)1.250s (-14.6% 🟢)0.000s (-57.3% 🟢)1.257s (-14.6% 🟢)0.341s481.24x
💻 LocalNext.js (Turbopack)1.433s (-5.3% 🟢)1.917s (-4.8%)0.000s (-37.5% 🟢)1.919s (-4.8%)0.486s321.95x
💻 LocalNitro1.451s (+34.9% 🔺)2.014s (+9.6% 🔺)0.000s (-52.9% 🟢)2.016s (+9.6% 🔺)0.566s301.97x
💻 LocalExpress1.572s (+15.4% 🔺)2.014s (~)0.000s (~)2.016s (~)0.444s302.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.647s (+34.8% 🔺)6.077s (+27.4% 🔺)0.000s (+20.0% 🔺)6.573s (+24.9% 🔺)1.926s101.00x
▲ VercelExpress5.355s (+76.7% 🔺)6.649s (+45.7% 🔺)0.000s (+Infinity% 🔺)7.225s (+43.4% 🔺)1.869s91.15x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.446s (-10.4% 🟢)2.100s (+1.8%)0.000s (NaN%)2.120s (+1.5%)0.674s291.00x
🐘 PostgresNitro1.601s (+3.2%)2.172s (+1.8%)0.000s (-100.0% 🟢)2.194s (+2.2%)0.593s281.11x
🐘 PostgresNext.js (Turbopack)2.201s (+4.3%)2.609s (+0.8%)0.000s (-100.0% 🟢)2.618s (+0.8%)0.417s231.52x
💻 LocalNext.js (Turbopack)3.608s (+24.4% 🔺)4.283s (+27.6% 🔺)0.001s (+126.7% 🔺)4.295s (+27.7% 🔺)0.688s152.49x
💻 LocalNitro3.665s (+66.1% 🔺)4.310s (+57.2% 🔺)0.001s (-10.2% 🟢)4.321s (+56.9% 🔺)0.656s142.53x
💻 LocalExpress4.419s (+50.8% 🔺)4.870s (+32.7% 🔺)0.000s (+4.6%)4.880s (+32.8% 🔺)0.461s133.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.466s (+13.6% 🔺)7.920s (+9.6% 🔺)0.000s (+Infinity% 🔺)8.414s (+9.4% 🔺)1.949s81.00x
▲ VercelNext.js (Turbopack)6.901s (-4.8%)8.409s (~)0.013s (+10071.4% 🔺)8.839s (~)1.938s71.07x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresExpress12/21
▲ VercelExpress15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres19/21
Next.js (Turbopack)🐘 Postgres12/21
Nitro🐘 Postgres17/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


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the full diff, built @workflow/core + @workflow/builders clean, and ran the affected tests (script-cache, runtime, constants, get-workflow-filenames) locally — all green.

The design is nicely fail-safe: workflowFilenames is best-effort, and a wrong/missing/extra filename only ever degrades to a cache miss → lazy compile (exactly today's behavior), with no determinism or correctness risk. The filename derivation also lines up with the runtime: since the registry lookup __private_workflows.get(workflowName) has to succeed, workflowName === workflowId, so the build-time moduleSpecifier matches what runWorkflow compiles under. Tests, comments, and the namespace-options refactor all look solid.

One tradeoff I'd like validated before merge (inline on runtime.ts), plus two smaller notes. Nothing blocking.

// (for stack-trace attribution); the builder passes that deduplicated set of
// filenames. When none are provided, fall back to a single representative
// filename so the bulk top-level parse is still done eagerly.
precompileWorkflowBundle(workflowCode, options?.workflowFilenames);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth validating against a multi-file benchmark. This eagerly compiles the full bundle once per workflow source file at module init — getCachedWorkflowScript does new Script(fullBundle, { filename }) per filename, and V8 keys its script compilation cache on the filename as well as the source, so there's no parse sharing across them (the existing script-cache.ts doc already notes "the whole bundle is compiled once per distinct filename").

The lazy path only ever compiled the filenames of workflows this process actually served. For an app with many workflow files where a given serverless instance only handles a subset, this front-loads — and increases total — cold-start parse work for workflows that may never run on this instance. The first-request win is real only if module init runs off that request's critical path on the platform; otherwise end-to-end latency for the first invocation could regress as the number of source files grows.

Does the benchmark cover an app with many distinct workflow source files (not just many functions in one file)? If not, that's the case I'd most want to see before merging.

* filename compiles the bulk of the bundle; the per-workflow filenames then
* recompile lazily (a cheap re-parse) on first replay.
*/
const PRECOMPILE_FALLBACK_FILENAME = '<workflow-bundle>';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fallback doesn't actually move any parse cost off the first replay. It caches a Script under <workflow-bundle>, but runWorkflow looks it up under the real moduleSpecifier, so the first replay still does a full new Script(...) under that real filename (different filename ⇒ full recompile, no reuse of the fallback entry). So the no-filenames path pays an extra full top-level parse at init for a Script that is never read, then parses again at replay — net overhead plus a dead cache entry, not a saving.

Since the builders now always pass workflowFilenames, this only affects manual/legacy callers, so it's low-impact. But consider either making the no-filenames case a no-op, or tightening the comment here and at lines 327-330 — both currently read as if the fallback warms the replay path, which it doesn't.

getQueueTopicPrefix('workflow', namespace);
const workflowFilenames = options?.workflowFilenames;
if (workflowFilenames && workflowFilenames.length > 0) {
const sorted = [...new Set(workflowFilenames)].sort();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor/nit: getWorkflowFilenamesFromManifest already returns a deduped, sorted array, so for the builder call sites this new Set(...).sort() is redundant work. It's harmless and reasonable as defensive normalization for direct callers of createWorkflowEntrypointOptionsCode — just flagging the double dedup/sort in case you'd rather pick one layer to own it.

Sign up for freeto 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

@TooTallNate@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' perf(core): precompile workflow vm.Script at module init by TooTallNate · Pull Request #2524 · vercel/workflow · GitHub
Skip to content

perf(core): precompile workflow vm.Script at module init - #2524

Open
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init
Open

perf(core): precompile workflow vm.Script at module init#2524
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init

Conversation

@TooTallNate

Copy link
Copy Markdown
Member

Summary

  • Precompile the workflow bundle's vm.Script at module-init time (when workflowEntrypoint is constructed) instead of lazily on the first queue delivery's replay, so the first replay is a cache hit rather than paying the bundle parse/compile on the critical path.
  • workflowEntrypoint gains an optional workflowFilenames option; the builders inline the deduplicated, sorted set of workflow source filenames into generated routes so the precompiled Script matches exactly what runWorkflow compiles under (parseWorkflowName(name)?.moduleSpecifier || name).
  • When no filenames are provided, the bundle is still precompiled once under a representative filename to pay the bulk top-level parse early.

Details

  • packages/core/src/vm/script-cache.ts: add precompileWorkflowScripts() (swallows compile errors so module init never breaks) and an isWorkflowScriptCached() test inspector.
  • packages/core/src/runtime.ts: workflowEntrypoint(workflowCode, { namespace?, workflowFilenames? }) warms the compiled-bundle cache at construction time.
  • packages/builders: getWorkflowFilenamesFromManifest() derives the per-file source filenames from the manifest's workflowIds; wired into all generated-route sites (base-builder workflow-only / combined / combined-watch, builder-deferred watch / production) via createWorkflowEntrypointOptionsCode({ workflowFilenames }).

Verified end-to-end against the example workbench: the generated flow route emits workflowEntrypoint(workflowCode, { workflowFilenames: [...] }) with the deduplicated, sorted filenames.

Testing

  • New unit tests: precompileWorkflowScripts (cache warming, identical-to-lazy Script, empty list, swallows syntax errors), createWorkflowEntrypointOptionsCode (filenames dedup/sort/combine), getWorkflowFilenamesFromManifest, and a workflowEntrypoint module-init precompile assertion.
  • @workflow/core and @workflow/builders build clean; affected test files pass.

Changeset

  • @workflow/core: minor (new workflowFilenames option + module-init precompile)
  • @workflow/builders, @workflow/next: patch (route wiring)

Compile the workflow bundle's `vm.Script` for each known workflow source
filename when `workflowEntrypoint` is constructed (module-init time),
rather than lazily on the first queue delivery's replay. Builders inline
the deduplicated, sorted set of workflow filenames into generated routes
via the new `workflowFilenames` entrypoint option, so the first replay is
a cache hit instead of paying the bundle parse/compile on the critical
path.
@TooTallNate
TooTallNate requested review from a team and ijjk as code ownersJune 18, 2026 21:36
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1ffc078

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

This PR includes changesets to release 16 packages
NameType
@workflow/buildersPatch
@workflow/nextPatch
@workflow/coreMinor
@workflow/astroPatch
@workflow/cliPatch
@workflow/nestPatch
@workflow/nitroPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/vitestPatch
workflowMinor
@workflow/web-sharedPatch
@workflow/webPatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production144022301672
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total8190210809272

❌ Failed Tests

▲ Vercel Production (2 failed)

astro (1 failed):

  • distributedAbortController - manual abort triggers signal | wrun_01KVEBJBCKBY07V9DFPPPE04VN | 🔍 observability

nextjs-turbopack (1 failed):

  • cancelRun via CLI - cancelling a running workflow | wrun_01KVEBB1EZ7BG88HYXXJCCJTXY | 🔍 observability

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro124127
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
❌ nextjs-turbopack14813
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.042s (-4.1%)1.006s (~)0.965s101.00x
💻 LocalNitro0.042s (+2.7%)1.005s (~)0.964s101.00x
💻 LocalNext.js (Turbopack)0.045s (-31.7% 🟢)1.005s (~)0.960s101.08x
🐘 PostgresExpress0.059s (-18.9% 🟢)1.012s (~)0.953s101.42x
🐘 PostgresNext.js (Turbopack)0.065s (-7.4% 🟢)1.012s (~)0.947s101.56x
🐘 PostgresNitro0.065s (+3.7%)1.013s (~)0.947s101.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.451s (+19.6% 🔺)2.595s (+13.1% 🔺)2.144s101.00x
▲ VercelNext.js (Turbopack)0.478s (+64.4% 🔺)2.473s (+30.7% 🔺)1.994s101.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.092s (+0.6%)2.005s (~)0.914s101.00x
💻 LocalExpress1.093s (-0.8%)2.006s (~)0.914s101.00x
🐘 PostgresNitro1.097s (-2.1%)2.008s (~)0.911s101.00x
🐘 PostgresExpress1.102s (~)2.010s (~)0.907s101.01x
💻 LocalNext.js (Turbopack)1.108s (-3.5%)2.006s (~)0.897s101.01x
🐘 PostgresNext.js (Turbopack)1.135s (-0.5%)2.009s (~)0.874s101.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.703s (-12.0% 🟢)3.912s (+6.4% 🔺)2.209s101.00x
▲ VercelNext.js (Turbopack)2.352s (+33.3% 🔺)4.394s (+18.4% 🔺)2.042s101.38x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.497s (~)11.016s (~)0.519s31.00x
🐘 PostgresNitro10.525s (~)11.018s (~)0.492s31.00x
💻 LocalNitro10.527s (~)11.023s (~)0.496s31.00x
💻 LocalExpress10.540s (~)11.023s (~)0.483s31.00x
💻 LocalNext.js (Turbopack)10.606s (-1.8%)11.021s (~)0.415s31.01x
🐘 PostgresNext.js (Turbopack)10.796s (-0.6%)11.018s (~)0.222s31.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)14.860s (+3.8%)16.723s (+2.6%)1.863s21.00x
▲ VercelExpress15.777s (-12.7% 🟢)17.890s (-10.4% 🟢)2.113s21.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.680s (-1.2%)14.019s (~)0.338s51.00x
💻 LocalExpress13.737s (~)14.027s (~)0.290s51.00x
🐘 PostgresNitro13.778s (~)14.017s (~)0.239s51.01x
💻 LocalNitro13.794s (+1.2%)14.027s (~)0.233s51.01x
💻 LocalNext.js (Turbopack)13.945s (-2.9%)14.024s (-6.7% 🟢)0.079s51.02x
🐘 PostgresNext.js (Turbopack)14.479s (~)15.019s (~)0.540s41.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.786s (-32.9% 🟢)25.665s (-30.3% 🟢)1.879s31.00x
▲ VercelExpress28.078s (+15.9% 🔺)30.151s (+15.2% 🔺)2.073s21.18x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express12.277s (-1.3%)13.017s (~)0.739s71.00x
💻 LocalNitro12.293s (+1.8%)13.024s (+1.0%)0.732s71.00x
🐘 PostgresNitro12.332s (-1.5%)13.016s (~)0.685s71.00x
💻 LocalExpress12.377s (-1.4%)13.026s (~)0.649s71.01x
💻 LocalNext.js (Turbopack)12.996s (-4.8%)13.453s (-4.1%)0.457s71.06x
🐘 PostgresNext.js (Turbopack)13.672s (-1.4%)14.022s (-1.0%)0.350s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.089s (-11.3% 🟢)33.544s (-9.1% 🟢)2.455s31.00x
▲ VercelNext.js (Turbopack)32.851s (-6.7% 🟢)35.009s (-5.2% 🟢)2.158s31.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.184s (-2.4%)2.007s (~)0.823s151.00x
🐘 PostgresNitro1.188s (-0.9%)2.007s (~)0.818s151.00x
💻 LocalExpress1.218s (+4.5%)2.006s (~)0.788s151.03x
💻 LocalNitro1.221s (+4.4%)2.007s (~)0.786s151.03x
🐘 PostgresNext.js (Turbopack)1.254s (-2.5%)2.008s (~)0.754s151.06x
💻 LocalNext.js (Turbopack)1.314s (+1.4%)2.006s (~)0.692s151.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.610s (+62.7% 🔺)5.619s (+44.6% 🔺)2.008s61.00x
▲ VercelNext.js (Turbopack)4.317s (+61.9% 🔺)6.102s (+48.9% 🔺)1.785s51.20x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.280s (-6.2% 🟢)2.007s (-20.0% 🟢)0.728s151.00x
🐘 PostgresExpress1.345s (-5.6% 🟢)2.008s (-16.1% 🟢)0.663s151.05x
🐘 PostgresNext.js (Turbopack)1.420s (-13.3% 🟢)2.007s (-16.1% 🟢)0.588s151.11x
💻 LocalExpress2.080s (+27.9% 🔺)2.592s (+29.2% 🔺)0.512s121.63x
💻 LocalNitro2.114s (+36.2% 🔺)3.009s (+49.6% 🔺)0.895s101.65x
💻 LocalNext.js (Turbopack)2.244s (+17.5% 🔺)2.825s (+23.2% 🔺)0.581s111.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.282s (+8.1% 🔺)6.113s (+7.8% 🔺)1.831s51.00x
▲ VercelNext.js (Turbopack)5.293s (+17.9% 🔺)7.023s (+8.4% 🔺)1.730s51.24x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.454s (-17.5% 🟢)3.209s (-17.4% 🟢)1.755s101.00x
🐘 PostgresNitro1.514s (-5.1% 🟢)3.454s (-13.9% 🟢)1.940s91.04x
🐘 PostgresNext.js (Turbopack)2.397s (-24.1% 🟢)3.211s (-25.4% 🟢)0.813s101.65x
💻 LocalNext.js (Turbopack)4.863s (-15.8% 🟢)5.510s (-11.4% 🟢)0.648s63.34x
💻 LocalNitro5.437s (+58.8% 🔺)6.016s (+50.0% 🔺)0.579s53.74x
💻 LocalExpress5.607s (+28.3% 🔺)6.014s (+23.6% 🔺)0.406s63.86x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.175s (-6.0% 🟢)6.691s (-15.6% 🟢)1.516s51.00x
▲ VercelNext.js (Turbopack)5.635s (~)7.580s (-1.8%)1.945s41.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.188s (-2.4%)2.008s (~)0.820s151.00x
💻 LocalNitro1.233s (+2.7%)2.006s (~)0.773s151.04x
💻 LocalExpress1.234s (-21.7% 🟢)2.006s (~)0.772s151.04x
🐘 PostgresNext.js (Turbopack)1.252s (-2.2%)2.006s (~)0.754s151.05x
🐘 PostgresNitro1.255s (+3.6%)2.008s (~)0.753s151.06x
💻 LocalNext.js (Turbopack)1.356s (-3.1%)2.006s (~)0.650s151.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.577s (+54.0% 🔺)5.261s (+38.3% 🔺)1.684s61.00x
▲ VercelNext.js (Turbopack)3.682s (-1.0%)5.338s (+2.1%)1.656s61.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.288s (-5.7% 🟢)2.007s (-13.3% 🟢)0.720s151.00x
🐘 PostgresNitro1.304s (-9.6% 🟢)2.006s (-16.2% 🟢)0.702s151.01x
🐘 PostgresNext.js (Turbopack)1.421s (-7.9% 🟢)2.007s (-9.7% 🟢)0.586s151.10x
💻 LocalExpress2.015s (+6.2% 🔺)2.736s (+27.3% 🔺)0.720s111.57x
💻 LocalNitro2.098s (+23.9% 🔺)2.827s (+40.7% 🔺)0.728s111.63x
💻 LocalNext.js (Turbopack)2.189s (+0.9%)2.733s (-9.1% 🟢)0.545s111.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.608s (-19.2% 🟢)5.326s (-13.5% 🟢)1.718s61.00x
▲ VercelExpress3.823s (+40.3% 🔺)5.641s (+23.4% 🔺)1.818s61.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.434s (-20.5% 🟢)3.885s (-9.6% 🟢)2.451s81.00x
🐘 PostgresExpress1.505s (-16.4% 🟢)3.761s (-6.2% 🟢)2.256s81.05x
🐘 PostgresNext.js (Turbopack)2.441s (-40.0% 🟢)3.210s (-27.8% 🟢)0.769s101.70x
💻 LocalNext.js (Turbopack)5.325s (-8.3% 🟢)6.013s (-6.3% 🟢)0.688s53.71x
💻 LocalNitro5.552s (+23.6% 🔺)6.015s (+20.0% 🔺)0.463s63.87x
💻 LocalExpress5.867s (+27.8% 🔺)6.350s (+26.7% 🔺)0.483s64.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.865s (-42.3% 🟢)6.596s (-35.6% 🟢)1.731s51.00x
▲ VercelNext.js (Turbopack)6.204s (+64.0% 🔺)8.242s (+57.5% 🔺)2.038s41.28x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.528s (-11.1% 🟢)1.006s (-3.3%)0.478s601.00x
💻 LocalNitro0.563s (+12.6% 🔺)1.005s (~)0.442s601.07x
🐘 PostgresExpress0.572s (~)1.023s (+1.7%)0.450s591.08x
💻 LocalExpress0.606s (-3.0%)1.005s (-1.6%)0.399s601.15x
💻 LocalNext.js (Turbopack)0.701s (-21.0% 🟢)1.004s (-3.4%)0.303s601.33x
🐘 PostgresNext.js (Turbopack)0.785s (-6.1% 🟢)1.006s (-1.7%)0.221s601.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.871s (-22.8% 🟢)6.946s (-14.7% 🟢)2.074s91.00x
▲ VercelExpress5.110s (+12.4% 🔺)7.398s (+14.2% 🔺)2.287s91.05x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (-9.2% 🟢)2.052s (+1.1%)0.792s451.00x
🐘 PostgresExpress1.290s (-4.9%)2.030s (~)0.740s451.02x
💻 LocalNitro1.403s (+18.1% 🔺)2.006s (~)0.604s451.11x
💻 LocalExpress1.462s (-1.8%)2.006s (~)0.545s451.16x
💻 LocalNext.js (Turbopack)1.790s (-14.8% 🟢)2.005s (-33.3% 🟢)0.216s451.42x
🐘 PostgresNext.js (Turbopack)1.829s (-5.8% 🟢)2.030s (-2.2%)0.201s451.45x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.122s (-36.4% 🟢)13.375s (-30.2% 🟢)2.253s71.00x
▲ VercelNext.js (Turbopack)11.452s (-15.8% 🟢)13.422s (-12.4% 🟢)1.971s71.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.498s (-10.7% 🟢)3.033s (-4.2%)0.535s401.00x
🐘 PostgresExpress2.538s (-6.4% 🟢)3.033s (-2.5%)0.495s401.02x
💻 LocalNitro3.063s (+12.2% 🔺)3.626s (+12.5% 🔺)0.564s341.23x
💻 LocalExpress3.206s (~)4.009s (~)0.804s301.28x
🐘 PostgresNext.js (Turbopack)3.697s (-4.4%)4.009s (-1.6%)0.313s301.48x
💻 LocalNext.js (Turbopack)3.828s (-11.9% 🟢)4.146s (-17.2% 🟢)0.318s291.53x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.676s (-16.9% 🟢)24.156s (-13.8% 🟢)2.480s61.00x
▲ VercelNext.js (Turbopack)23.635s (-5.4% 🟢)25.770s (-3.8%)2.134s51.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.216s (-8.1% 🟢)1.006s (~)0.789s601.00x
🐘 PostgresExpress0.221s (-4.5%)1.006s (~)0.785s601.02x
🐘 PostgresNext.js (Turbopack)0.261s (-11.3% 🟢)1.006s (~)0.745s601.21x
💻 LocalNitro0.428s (+14.9% 🔺)1.005s (~)0.576s601.98x
💻 LocalExpress0.430s (-2.2%)1.005s (~)0.574s601.99x
💻 LocalNext.js (Turbopack)0.559s (-4.0%)1.004s (~)0.445s602.58x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.453s (+58.2% 🔺)4.282s (+49.3% 🔺)1.830s151.00x
▲ VercelNext.js (Turbopack)2.537s (+35.5% 🔺)4.323s (+11.2% 🔺)1.787s141.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.314s (-11.6% 🟢)1.006s (-3.3%)0.692s901.00x
🐘 PostgresNitro0.325s (-5.0%)1.017s (~)0.692s891.04x
🐘 PostgresNext.js (Turbopack)0.435s (-19.2% 🟢)1.006s (-10.0% 🟢)0.571s901.39x
💻 LocalNitro2.092s (+37.3% 🔺)2.537s (+17.9% 🔺)0.444s366.66x
💻 LocalExpress2.133s (+2.1%)2.581s (-2.8%)0.448s356.79x
💻 LocalNext.js (Turbopack)2.357s (+1.1%)3.010s (-2.1%)0.653s307.50x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.706s (-7.5% 🟢)4.760s (-0.8%)2.054s201.00x
▲ VercelNext.js (Turbopack)3.147s (+3.4%)4.862s (+1.5%)1.715s191.16x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.517s (-9.0% 🟢)1.059s (-14.1% 🟢)0.542s1141.00x
🐘 PostgresExpress0.517s (-9.1% 🟢)1.107s (-9.0% 🟢)0.590s1091.00x
🐘 PostgresNext.js (Turbopack)1.665s (-36.4% 🟢)2.403s (-30.8% 🟢)0.738s513.22x
💻 LocalNext.js (Turbopack)9.274s (-13.8% 🟢)10.192s (-11.9% 🟢)0.918s1217.94x
💻 LocalExpress10.126s (+21.9% 🔺)10.779s (+21.4% 🔺)0.653s1219.59x
💻 LocalNitro10.299s (+63.2% 🔺)10.945s (+62.3% 🔺)0.646s1219.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.010s (-26.6% 🟢)6.009s (-15.2% 🟢)1.998s201.00x
▲ VercelNext.js (Turbopack)5.104s (+5.4% 🔺)6.996s (+7.1% 🔺)1.892s181.27x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.157s (-1.8%)1.999s (~)0.001s (-18.2% 🟢)2.010s (~)0.853s101.00x
🐘 PostgresNitro1.164s (~)1.999s (~)0.001s (+20.0% 🔺)2.010s (~)0.847s101.01x
💻 LocalNitro1.167s (+4.4%)2.006s (~)0.012s (-55.4% 🟢)2.020s (-0.9%)0.853s101.01x
💻 LocalExpress1.170s (+1.7%)2.005s (~)0.012s (+20.8% 🔺)2.020s (~)0.850s101.01x
💻 LocalNext.js (Turbopack)1.184s (-2.2%)2.002s (~)0.008s (-36.0% 🟢)2.014s (~)0.830s101.02x
🐘 PostgresNext.js (Turbopack)1.217s (-1.0%)2.001s (~)0.001s (-30.8% 🟢)2.010s (~)0.793s101.05x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.670s (+5.9% 🔺)3.838s (~)4.711s (+483.4% 🔺)9.069s (+78.4% 🔺)6.399s101.00x
▲ VercelExpress2.901s (+20.8% 🔺)4.452s (+21.0% 🔺)4.320s (+483.0% 🔺)9.303s (+90.8% 🔺)6.401s101.09x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.552s (-2.0%)2.003s (~)0.005s (+11.4% 🔺)2.026s (~)0.474s301.00x
🐘 PostgresNitro1.566s (-0.8%)2.005s (~)0.005s (-9.9% 🟢)2.026s (~)0.460s301.01x
💻 LocalNitro1.568s (+9.1% 🔺)2.011s (~)0.014s (-24.0% 🟢)2.026s (~)0.458s301.01x
💻 LocalExpress1.588s (+1.4%)2.010s (~)0.011s (-13.7% 🟢)2.023s (~)0.435s301.02x
💻 LocalNext.js (Turbopack)1.614s (-7.8% 🟢)2.008s (~)0.012s (-5.7% 🟢)2.022s (~)0.408s301.04x
🐘 PostgresNext.js (Turbopack)1.755s (-1.7%)2.010s (~)0.005s (-0.6%)2.025s (~)0.269s301.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.320s (+30.3% 🔺)10.378s (+32.9% 🔺)0.371s (+107.3% 🔺)11.213s (+32.6% 🔺)2.892s61.00x
▲ VercelNext.js (Turbopack)8.347s (-1.7%)10.004s (+1.9%)0.488s (+85.4% 🔺)10.955s (+3.6%)2.608s61.00x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.737s (-4.7%)1.064s (+1.5%)0.000s (+96.4% 🔺)1.086s (-0.7%)0.349s561.00x
🐘 PostgresExpress0.754s (-1.3%)1.046s (+2.1%)0.000s (-50.0% 🟢)1.060s (~)0.306s571.02x
🐘 PostgresNext.js (Turbopack)0.916s (-10.2% 🟢)1.250s (-14.6% 🟢)0.000s (-57.3% 🟢)1.257s (-14.6% 🟢)0.341s481.24x
💻 LocalNext.js (Turbopack)1.433s (-5.3% 🟢)1.917s (-4.8%)0.000s (-37.5% 🟢)1.919s (-4.8%)0.486s321.95x
💻 LocalNitro1.451s (+34.9% 🔺)2.014s (+9.6% 🔺)0.000s (-52.9% 🟢)2.016s (+9.6% 🔺)0.566s301.97x
💻 LocalExpress1.572s (+15.4% 🔺)2.014s (~)0.000s (~)2.016s (~)0.444s302.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.647s (+34.8% 🔺)6.077s (+27.4% 🔺)0.000s (+20.0% 🔺)6.573s (+24.9% 🔺)1.926s101.00x
▲ VercelExpress5.355s (+76.7% 🔺)6.649s (+45.7% 🔺)0.000s (+Infinity% 🔺)7.225s (+43.4% 🔺)1.869s91.15x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.446s (-10.4% 🟢)2.100s (+1.8%)0.000s (NaN%)2.120s (+1.5%)0.674s291.00x
🐘 PostgresNitro1.601s (+3.2%)2.172s (+1.8%)0.000s (-100.0% 🟢)2.194s (+2.2%)0.593s281.11x
🐘 PostgresNext.js (Turbopack)2.201s (+4.3%)2.609s (+0.8%)0.000s (-100.0% 🟢)2.618s (+0.8%)0.417s231.52x
💻 LocalNext.js (Turbopack)3.608s (+24.4% 🔺)4.283s (+27.6% 🔺)0.001s (+126.7% 🔺)4.295s (+27.7% 🔺)0.688s152.49x
💻 LocalNitro3.665s (+66.1% 🔺)4.310s (+57.2% 🔺)0.001s (-10.2% 🟢)4.321s (+56.9% 🔺)0.656s142.53x
💻 LocalExpress4.419s (+50.8% 🔺)4.870s (+32.7% 🔺)0.000s (+4.6%)4.880s (+32.8% 🔺)0.461s133.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.466s (+13.6% 🔺)7.920s (+9.6% 🔺)0.000s (+Infinity% 🔺)8.414s (+9.4% 🔺)1.949s81.00x
▲ VercelNext.js (Turbopack)6.901s (-4.8%)8.409s (~)0.013s (+10071.4% 🔺)8.839s (~)1.938s71.07x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresExpress12/21
▲ VercelExpress15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres19/21
Next.js (Turbopack)🐘 Postgres12/21
Nitro🐘 Postgres17/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


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the full diff, built @workflow/core + @workflow/builders clean, and ran the affected tests (script-cache, runtime, constants, get-workflow-filenames) locally — all green.

The design is nicely fail-safe: workflowFilenames is best-effort, and a wrong/missing/extra filename only ever degrades to a cache miss → lazy compile (exactly today's behavior), with no determinism or correctness risk. The filename derivation also lines up with the runtime: since the registry lookup __private_workflows.get(workflowName) has to succeed, workflowName === workflowId, so the build-time moduleSpecifier matches what runWorkflow compiles under. Tests, comments, and the namespace-options refactor all look solid.

One tradeoff I'd like validated before merge (inline on runtime.ts), plus two smaller notes. Nothing blocking.

// (for stack-trace attribution); the builder passes that deduplicated set of
// filenames. When none are provided, fall back to a single representative
// filename so the bulk top-level parse is still done eagerly.
precompileWorkflowBundle(workflowCode, options?.workflowFilenames);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth validating against a multi-file benchmark. This eagerly compiles the full bundle once per workflow source file at module init — getCachedWorkflowScript does new Script(fullBundle, { filename }) per filename, and V8 keys its script compilation cache on the filename as well as the source, so there's no parse sharing across them (the existing script-cache.ts doc already notes "the whole bundle is compiled once per distinct filename").

The lazy path only ever compiled the filenames of workflows this process actually served. For an app with many workflow files where a given serverless instance only handles a subset, this front-loads — and increases total — cold-start parse work for workflows that may never run on this instance. The first-request win is real only if module init runs off that request's critical path on the platform; otherwise end-to-end latency for the first invocation could regress as the number of source files grows.

Does the benchmark cover an app with many distinct workflow source files (not just many functions in one file)? If not, that's the case I'd most want to see before merging.

* filename compiles the bulk of the bundle; the per-workflow filenames then
* recompile lazily (a cheap re-parse) on first replay.
*/
const PRECOMPILE_FALLBACK_FILENAME = '<workflow-bundle>';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fallback doesn't actually move any parse cost off the first replay. It caches a Script under <workflow-bundle>, but runWorkflow looks it up under the real moduleSpecifier, so the first replay still does a full new Script(...) under that real filename (different filename ⇒ full recompile, no reuse of the fallback entry). So the no-filenames path pays an extra full top-level parse at init for a Script that is never read, then parses again at replay — net overhead plus a dead cache entry, not a saving.

Since the builders now always pass workflowFilenames, this only affects manual/legacy callers, so it's low-impact. But consider either making the no-filenames case a no-op, or tightening the comment here and at lines 327-330 — both currently read as if the fallback warms the replay path, which it doesn't.

getQueueTopicPrefix('workflow', namespace);
const workflowFilenames = options?.workflowFilenames;
if (workflowFilenames && workflowFilenames.length > 0) {
const sorted = [...new Set(workflowFilenames)].sort();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor/nit: getWorkflowFilenamesFromManifest already returns a deduped, sorted array, so for the builder call sites this new Set(...).sort() is redundant work. It's harmless and reasonable as defensive normalization for direct callers of createWorkflowEntrypointOptionsCode — just flagging the double dedup/sort in case you'd rather pick one layer to own it.

Sign up for freeto 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

@TooTallNate@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' perf(core): precompile workflow vm.Script at module init by TooTallNate · Pull Request #2524 · vercel/workflow · GitHub
Skip to content

perf(core): precompile workflow vm.Script at module init - #2524

Open
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init
Open

perf(core): precompile workflow vm.Script at module init#2524
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init

Conversation

@TooTallNate

Copy link
Copy Markdown
Member

Summary

  • Precompile the workflow bundle's vm.Script at module-init time (when workflowEntrypoint is constructed) instead of lazily on the first queue delivery's replay, so the first replay is a cache hit rather than paying the bundle parse/compile on the critical path.
  • workflowEntrypoint gains an optional workflowFilenames option; the builders inline the deduplicated, sorted set of workflow source filenames into generated routes so the precompiled Script matches exactly what runWorkflow compiles under (parseWorkflowName(name)?.moduleSpecifier || name).
  • When no filenames are provided, the bundle is still precompiled once under a representative filename to pay the bulk top-level parse early.

Details

  • packages/core/src/vm/script-cache.ts: add precompileWorkflowScripts() (swallows compile errors so module init never breaks) and an isWorkflowScriptCached() test inspector.
  • packages/core/src/runtime.ts: workflowEntrypoint(workflowCode, { namespace?, workflowFilenames? }) warms the compiled-bundle cache at construction time.
  • packages/builders: getWorkflowFilenamesFromManifest() derives the per-file source filenames from the manifest's workflowIds; wired into all generated-route sites (base-builder workflow-only / combined / combined-watch, builder-deferred watch / production) via createWorkflowEntrypointOptionsCode({ workflowFilenames }).

Verified end-to-end against the example workbench: the generated flow route emits workflowEntrypoint(workflowCode, { workflowFilenames: [...] }) with the deduplicated, sorted filenames.

Testing

  • New unit tests: precompileWorkflowScripts (cache warming, identical-to-lazy Script, empty list, swallows syntax errors), createWorkflowEntrypointOptionsCode (filenames dedup/sort/combine), getWorkflowFilenamesFromManifest, and a workflowEntrypoint module-init precompile assertion.
  • @workflow/core and @workflow/builders build clean; affected test files pass.

Changeset

  • @workflow/core: minor (new workflowFilenames option + module-init precompile)
  • @workflow/builders, @workflow/next: patch (route wiring)

Compile the workflow bundle's `vm.Script` for each known workflow source
filename when `workflowEntrypoint` is constructed (module-init time),
rather than lazily on the first queue delivery's replay. Builders inline
the deduplicated, sorted set of workflow filenames into generated routes
via the new `workflowFilenames` entrypoint option, so the first replay is
a cache hit instead of paying the bundle parse/compile on the critical
path.
@TooTallNate
TooTallNate requested review from a team and ijjk as code ownersJune 18, 2026 21:36
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1ffc078

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

This PR includes changesets to release 16 packages
NameType
@workflow/buildersPatch
@workflow/nextPatch
@workflow/coreMinor
@workflow/astroPatch
@workflow/cliPatch
@workflow/nestPatch
@workflow/nitroPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/vitestPatch
workflowMinor
@workflow/web-sharedPatch
@workflow/webPatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production144022301672
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total8190210809272

❌ Failed Tests

▲ Vercel Production (2 failed)

astro (1 failed):

  • distributedAbortController - manual abort triggers signal | wrun_01KVEBJBCKBY07V9DFPPPE04VN | 🔍 observability

nextjs-turbopack (1 failed):

  • cancelRun via CLI - cancelling a running workflow | wrun_01KVEBB1EZ7BG88HYXXJCCJTXY | 🔍 observability

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro124127
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
❌ nextjs-turbopack14813
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.042s (-4.1%)1.006s (~)0.965s101.00x
💻 LocalNitro0.042s (+2.7%)1.005s (~)0.964s101.00x
💻 LocalNext.js (Turbopack)0.045s (-31.7% 🟢)1.005s (~)0.960s101.08x
🐘 PostgresExpress0.059s (-18.9% 🟢)1.012s (~)0.953s101.42x
🐘 PostgresNext.js (Turbopack)0.065s (-7.4% 🟢)1.012s (~)0.947s101.56x
🐘 PostgresNitro0.065s (+3.7%)1.013s (~)0.947s101.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.451s (+19.6% 🔺)2.595s (+13.1% 🔺)2.144s101.00x
▲ VercelNext.js (Turbopack)0.478s (+64.4% 🔺)2.473s (+30.7% 🔺)1.994s101.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.092s (+0.6%)2.005s (~)0.914s101.00x
💻 LocalExpress1.093s (-0.8%)2.006s (~)0.914s101.00x
🐘 PostgresNitro1.097s (-2.1%)2.008s (~)0.911s101.00x
🐘 PostgresExpress1.102s (~)2.010s (~)0.907s101.01x
💻 LocalNext.js (Turbopack)1.108s (-3.5%)2.006s (~)0.897s101.01x
🐘 PostgresNext.js (Turbopack)1.135s (-0.5%)2.009s (~)0.874s101.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.703s (-12.0% 🟢)3.912s (+6.4% 🔺)2.209s101.00x
▲ VercelNext.js (Turbopack)2.352s (+33.3% 🔺)4.394s (+18.4% 🔺)2.042s101.38x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.497s (~)11.016s (~)0.519s31.00x
🐘 PostgresNitro10.525s (~)11.018s (~)0.492s31.00x
💻 LocalNitro10.527s (~)11.023s (~)0.496s31.00x
💻 LocalExpress10.540s (~)11.023s (~)0.483s31.00x
💻 LocalNext.js (Turbopack)10.606s (-1.8%)11.021s (~)0.415s31.01x
🐘 PostgresNext.js (Turbopack)10.796s (-0.6%)11.018s (~)0.222s31.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)14.860s (+3.8%)16.723s (+2.6%)1.863s21.00x
▲ VercelExpress15.777s (-12.7% 🟢)17.890s (-10.4% 🟢)2.113s21.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.680s (-1.2%)14.019s (~)0.338s51.00x
💻 LocalExpress13.737s (~)14.027s (~)0.290s51.00x
🐘 PostgresNitro13.778s (~)14.017s (~)0.239s51.01x
💻 LocalNitro13.794s (+1.2%)14.027s (~)0.233s51.01x
💻 LocalNext.js (Turbopack)13.945s (-2.9%)14.024s (-6.7% 🟢)0.079s51.02x
🐘 PostgresNext.js (Turbopack)14.479s (~)15.019s (~)0.540s41.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.786s (-32.9% 🟢)25.665s (-30.3% 🟢)1.879s31.00x
▲ VercelExpress28.078s (+15.9% 🔺)30.151s (+15.2% 🔺)2.073s21.18x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express12.277s (-1.3%)13.017s (~)0.739s71.00x
💻 LocalNitro12.293s (+1.8%)13.024s (+1.0%)0.732s71.00x
🐘 PostgresNitro12.332s (-1.5%)13.016s (~)0.685s71.00x
💻 LocalExpress12.377s (-1.4%)13.026s (~)0.649s71.01x
💻 LocalNext.js (Turbopack)12.996s (-4.8%)13.453s (-4.1%)0.457s71.06x
🐘 PostgresNext.js (Turbopack)13.672s (-1.4%)14.022s (-1.0%)0.350s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.089s (-11.3% 🟢)33.544s (-9.1% 🟢)2.455s31.00x
▲ VercelNext.js (Turbopack)32.851s (-6.7% 🟢)35.009s (-5.2% 🟢)2.158s31.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.184s (-2.4%)2.007s (~)0.823s151.00x
🐘 PostgresNitro1.188s (-0.9%)2.007s (~)0.818s151.00x
💻 LocalExpress1.218s (+4.5%)2.006s (~)0.788s151.03x
💻 LocalNitro1.221s (+4.4%)2.007s (~)0.786s151.03x
🐘 PostgresNext.js (Turbopack)1.254s (-2.5%)2.008s (~)0.754s151.06x
💻 LocalNext.js (Turbopack)1.314s (+1.4%)2.006s (~)0.692s151.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.610s (+62.7% 🔺)5.619s (+44.6% 🔺)2.008s61.00x
▲ VercelNext.js (Turbopack)4.317s (+61.9% 🔺)6.102s (+48.9% 🔺)1.785s51.20x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.280s (-6.2% 🟢)2.007s (-20.0% 🟢)0.728s151.00x
🐘 PostgresExpress1.345s (-5.6% 🟢)2.008s (-16.1% 🟢)0.663s151.05x
🐘 PostgresNext.js (Turbopack)1.420s (-13.3% 🟢)2.007s (-16.1% 🟢)0.588s151.11x
💻 LocalExpress2.080s (+27.9% 🔺)2.592s (+29.2% 🔺)0.512s121.63x
💻 LocalNitro2.114s (+36.2% 🔺)3.009s (+49.6% 🔺)0.895s101.65x
💻 LocalNext.js (Turbopack)2.244s (+17.5% 🔺)2.825s (+23.2% 🔺)0.581s111.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.282s (+8.1% 🔺)6.113s (+7.8% 🔺)1.831s51.00x
▲ VercelNext.js (Turbopack)5.293s (+17.9% 🔺)7.023s (+8.4% 🔺)1.730s51.24x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.454s (-17.5% 🟢)3.209s (-17.4% 🟢)1.755s101.00x
🐘 PostgresNitro1.514s (-5.1% 🟢)3.454s (-13.9% 🟢)1.940s91.04x
🐘 PostgresNext.js (Turbopack)2.397s (-24.1% 🟢)3.211s (-25.4% 🟢)0.813s101.65x
💻 LocalNext.js (Turbopack)4.863s (-15.8% 🟢)5.510s (-11.4% 🟢)0.648s63.34x
💻 LocalNitro5.437s (+58.8% 🔺)6.016s (+50.0% 🔺)0.579s53.74x
💻 LocalExpress5.607s (+28.3% 🔺)6.014s (+23.6% 🔺)0.406s63.86x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.175s (-6.0% 🟢)6.691s (-15.6% 🟢)1.516s51.00x
▲ VercelNext.js (Turbopack)5.635s (~)7.580s (-1.8%)1.945s41.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.188s (-2.4%)2.008s (~)0.820s151.00x
💻 LocalNitro1.233s (+2.7%)2.006s (~)0.773s151.04x
💻 LocalExpress1.234s (-21.7% 🟢)2.006s (~)0.772s151.04x
🐘 PostgresNext.js (Turbopack)1.252s (-2.2%)2.006s (~)0.754s151.05x
🐘 PostgresNitro1.255s (+3.6%)2.008s (~)0.753s151.06x
💻 LocalNext.js (Turbopack)1.356s (-3.1%)2.006s (~)0.650s151.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.577s (+54.0% 🔺)5.261s (+38.3% 🔺)1.684s61.00x
▲ VercelNext.js (Turbopack)3.682s (-1.0%)5.338s (+2.1%)1.656s61.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.288s (-5.7% 🟢)2.007s (-13.3% 🟢)0.720s151.00x
🐘 PostgresNitro1.304s (-9.6% 🟢)2.006s (-16.2% 🟢)0.702s151.01x
🐘 PostgresNext.js (Turbopack)1.421s (-7.9% 🟢)2.007s (-9.7% 🟢)0.586s151.10x
💻 LocalExpress2.015s (+6.2% 🔺)2.736s (+27.3% 🔺)0.720s111.57x
💻 LocalNitro2.098s (+23.9% 🔺)2.827s (+40.7% 🔺)0.728s111.63x
💻 LocalNext.js (Turbopack)2.189s (+0.9%)2.733s (-9.1% 🟢)0.545s111.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.608s (-19.2% 🟢)5.326s (-13.5% 🟢)1.718s61.00x
▲ VercelExpress3.823s (+40.3% 🔺)5.641s (+23.4% 🔺)1.818s61.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.434s (-20.5% 🟢)3.885s (-9.6% 🟢)2.451s81.00x
🐘 PostgresExpress1.505s (-16.4% 🟢)3.761s (-6.2% 🟢)2.256s81.05x
🐘 PostgresNext.js (Turbopack)2.441s (-40.0% 🟢)3.210s (-27.8% 🟢)0.769s101.70x
💻 LocalNext.js (Turbopack)5.325s (-8.3% 🟢)6.013s (-6.3% 🟢)0.688s53.71x
💻 LocalNitro5.552s (+23.6% 🔺)6.015s (+20.0% 🔺)0.463s63.87x
💻 LocalExpress5.867s (+27.8% 🔺)6.350s (+26.7% 🔺)0.483s64.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.865s (-42.3% 🟢)6.596s (-35.6% 🟢)1.731s51.00x
▲ VercelNext.js (Turbopack)6.204s (+64.0% 🔺)8.242s (+57.5% 🔺)2.038s41.28x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.528s (-11.1% 🟢)1.006s (-3.3%)0.478s601.00x
💻 LocalNitro0.563s (+12.6% 🔺)1.005s (~)0.442s601.07x
🐘 PostgresExpress0.572s (~)1.023s (+1.7%)0.450s591.08x
💻 LocalExpress0.606s (-3.0%)1.005s (-1.6%)0.399s601.15x
💻 LocalNext.js (Turbopack)0.701s (-21.0% 🟢)1.004s (-3.4%)0.303s601.33x
🐘 PostgresNext.js (Turbopack)0.785s (-6.1% 🟢)1.006s (-1.7%)0.221s601.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.871s (-22.8% 🟢)6.946s (-14.7% 🟢)2.074s91.00x
▲ VercelExpress5.110s (+12.4% 🔺)7.398s (+14.2% 🔺)2.287s91.05x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (-9.2% 🟢)2.052s (+1.1%)0.792s451.00x
🐘 PostgresExpress1.290s (-4.9%)2.030s (~)0.740s451.02x
💻 LocalNitro1.403s (+18.1% 🔺)2.006s (~)0.604s451.11x
💻 LocalExpress1.462s (-1.8%)2.006s (~)0.545s451.16x
💻 LocalNext.js (Turbopack)1.790s (-14.8% 🟢)2.005s (-33.3% 🟢)0.216s451.42x
🐘 PostgresNext.js (Turbopack)1.829s (-5.8% 🟢)2.030s (-2.2%)0.201s451.45x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.122s (-36.4% 🟢)13.375s (-30.2% 🟢)2.253s71.00x
▲ VercelNext.js (Turbopack)11.452s (-15.8% 🟢)13.422s (-12.4% 🟢)1.971s71.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.498s (-10.7% 🟢)3.033s (-4.2%)0.535s401.00x
🐘 PostgresExpress2.538s (-6.4% 🟢)3.033s (-2.5%)0.495s401.02x
💻 LocalNitro3.063s (+12.2% 🔺)3.626s (+12.5% 🔺)0.564s341.23x
💻 LocalExpress3.206s (~)4.009s (~)0.804s301.28x
🐘 PostgresNext.js (Turbopack)3.697s (-4.4%)4.009s (-1.6%)0.313s301.48x
💻 LocalNext.js (Turbopack)3.828s (-11.9% 🟢)4.146s (-17.2% 🟢)0.318s291.53x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.676s (-16.9% 🟢)24.156s (-13.8% 🟢)2.480s61.00x
▲ VercelNext.js (Turbopack)23.635s (-5.4% 🟢)25.770s (-3.8%)2.134s51.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.216s (-8.1% 🟢)1.006s (~)0.789s601.00x
🐘 PostgresExpress0.221s (-4.5%)1.006s (~)0.785s601.02x
🐘 PostgresNext.js (Turbopack)0.261s (-11.3% 🟢)1.006s (~)0.745s601.21x
💻 LocalNitro0.428s (+14.9% 🔺)1.005s (~)0.576s601.98x
💻 LocalExpress0.430s (-2.2%)1.005s (~)0.574s601.99x
💻 LocalNext.js (Turbopack)0.559s (-4.0%)1.004s (~)0.445s602.58x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.453s (+58.2% 🔺)4.282s (+49.3% 🔺)1.830s151.00x
▲ VercelNext.js (Turbopack)2.537s (+35.5% 🔺)4.323s (+11.2% 🔺)1.787s141.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.314s (-11.6% 🟢)1.006s (-3.3%)0.692s901.00x
🐘 PostgresNitro0.325s (-5.0%)1.017s (~)0.692s891.04x
🐘 PostgresNext.js (Turbopack)0.435s (-19.2% 🟢)1.006s (-10.0% 🟢)0.571s901.39x
💻 LocalNitro2.092s (+37.3% 🔺)2.537s (+17.9% 🔺)0.444s366.66x
💻 LocalExpress2.133s (+2.1%)2.581s (-2.8%)0.448s356.79x
💻 LocalNext.js (Turbopack)2.357s (+1.1%)3.010s (-2.1%)0.653s307.50x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.706s (-7.5% 🟢)4.760s (-0.8%)2.054s201.00x
▲ VercelNext.js (Turbopack)3.147s (+3.4%)4.862s (+1.5%)1.715s191.16x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.517s (-9.0% 🟢)1.059s (-14.1% 🟢)0.542s1141.00x
🐘 PostgresExpress0.517s (-9.1% 🟢)1.107s (-9.0% 🟢)0.590s1091.00x
🐘 PostgresNext.js (Turbopack)1.665s (-36.4% 🟢)2.403s (-30.8% 🟢)0.738s513.22x
💻 LocalNext.js (Turbopack)9.274s (-13.8% 🟢)10.192s (-11.9% 🟢)0.918s1217.94x
💻 LocalExpress10.126s (+21.9% 🔺)10.779s (+21.4% 🔺)0.653s1219.59x
💻 LocalNitro10.299s (+63.2% 🔺)10.945s (+62.3% 🔺)0.646s1219.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.010s (-26.6% 🟢)6.009s (-15.2% 🟢)1.998s201.00x
▲ VercelNext.js (Turbopack)5.104s (+5.4% 🔺)6.996s (+7.1% 🔺)1.892s181.27x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.157s (-1.8%)1.999s (~)0.001s (-18.2% 🟢)2.010s (~)0.853s101.00x
🐘 PostgresNitro1.164s (~)1.999s (~)0.001s (+20.0% 🔺)2.010s (~)0.847s101.01x
💻 LocalNitro1.167s (+4.4%)2.006s (~)0.012s (-55.4% 🟢)2.020s (-0.9%)0.853s101.01x
💻 LocalExpress1.170s (+1.7%)2.005s (~)0.012s (+20.8% 🔺)2.020s (~)0.850s101.01x
💻 LocalNext.js (Turbopack)1.184s (-2.2%)2.002s (~)0.008s (-36.0% 🟢)2.014s (~)0.830s101.02x
🐘 PostgresNext.js (Turbopack)1.217s (-1.0%)2.001s (~)0.001s (-30.8% 🟢)2.010s (~)0.793s101.05x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.670s (+5.9% 🔺)3.838s (~)4.711s (+483.4% 🔺)9.069s (+78.4% 🔺)6.399s101.00x
▲ VercelExpress2.901s (+20.8% 🔺)4.452s (+21.0% 🔺)4.320s (+483.0% 🔺)9.303s (+90.8% 🔺)6.401s101.09x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.552s (-2.0%)2.003s (~)0.005s (+11.4% 🔺)2.026s (~)0.474s301.00x
🐘 PostgresNitro1.566s (-0.8%)2.005s (~)0.005s (-9.9% 🟢)2.026s (~)0.460s301.01x
💻 LocalNitro1.568s (+9.1% 🔺)2.011s (~)0.014s (-24.0% 🟢)2.026s (~)0.458s301.01x
💻 LocalExpress1.588s (+1.4%)2.010s (~)0.011s (-13.7% 🟢)2.023s (~)0.435s301.02x
💻 LocalNext.js (Turbopack)1.614s (-7.8% 🟢)2.008s (~)0.012s (-5.7% 🟢)2.022s (~)0.408s301.04x
🐘 PostgresNext.js (Turbopack)1.755s (-1.7%)2.010s (~)0.005s (-0.6%)2.025s (~)0.269s301.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.320s (+30.3% 🔺)10.378s (+32.9% 🔺)0.371s (+107.3% 🔺)11.213s (+32.6% 🔺)2.892s61.00x
▲ VercelNext.js (Turbopack)8.347s (-1.7%)10.004s (+1.9%)0.488s (+85.4% 🔺)10.955s (+3.6%)2.608s61.00x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.737s (-4.7%)1.064s (+1.5%)0.000s (+96.4% 🔺)1.086s (-0.7%)0.349s561.00x
🐘 PostgresExpress0.754s (-1.3%)1.046s (+2.1%)0.000s (-50.0% 🟢)1.060s (~)0.306s571.02x
🐘 PostgresNext.js (Turbopack)0.916s (-10.2% 🟢)1.250s (-14.6% 🟢)0.000s (-57.3% 🟢)1.257s (-14.6% 🟢)0.341s481.24x
💻 LocalNext.js (Turbopack)1.433s (-5.3% 🟢)1.917s (-4.8%)0.000s (-37.5% 🟢)1.919s (-4.8%)0.486s321.95x
💻 LocalNitro1.451s (+34.9% 🔺)2.014s (+9.6% 🔺)0.000s (-52.9% 🟢)2.016s (+9.6% 🔺)0.566s301.97x
💻 LocalExpress1.572s (+15.4% 🔺)2.014s (~)0.000s (~)2.016s (~)0.444s302.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.647s (+34.8% 🔺)6.077s (+27.4% 🔺)0.000s (+20.0% 🔺)6.573s (+24.9% 🔺)1.926s101.00x
▲ VercelExpress5.355s (+76.7% 🔺)6.649s (+45.7% 🔺)0.000s (+Infinity% 🔺)7.225s (+43.4% 🔺)1.869s91.15x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.446s (-10.4% 🟢)2.100s (+1.8%)0.000s (NaN%)2.120s (+1.5%)0.674s291.00x
🐘 PostgresNitro1.601s (+3.2%)2.172s (+1.8%)0.000s (-100.0% 🟢)2.194s (+2.2%)0.593s281.11x
🐘 PostgresNext.js (Turbopack)2.201s (+4.3%)2.609s (+0.8%)0.000s (-100.0% 🟢)2.618s (+0.8%)0.417s231.52x
💻 LocalNext.js (Turbopack)3.608s (+24.4% 🔺)4.283s (+27.6% 🔺)0.001s (+126.7% 🔺)4.295s (+27.7% 🔺)0.688s152.49x
💻 LocalNitro3.665s (+66.1% 🔺)4.310s (+57.2% 🔺)0.001s (-10.2% 🟢)4.321s (+56.9% 🔺)0.656s142.53x
💻 LocalExpress4.419s (+50.8% 🔺)4.870s (+32.7% 🔺)0.000s (+4.6%)4.880s (+32.8% 🔺)0.461s133.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.466s (+13.6% 🔺)7.920s (+9.6% 🔺)0.000s (+Infinity% 🔺)8.414s (+9.4% 🔺)1.949s81.00x
▲ VercelNext.js (Turbopack)6.901s (-4.8%)8.409s (~)0.013s (+10071.4% 🔺)8.839s (~)1.938s71.07x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresExpress12/21
▲ VercelExpress15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres19/21
Next.js (Turbopack)🐘 Postgres12/21
Nitro🐘 Postgres17/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


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the full diff, built @workflow/core + @workflow/builders clean, and ran the affected tests (script-cache, runtime, constants, get-workflow-filenames) locally — all green.

The design is nicely fail-safe: workflowFilenames is best-effort, and a wrong/missing/extra filename only ever degrades to a cache miss → lazy compile (exactly today's behavior), with no determinism or correctness risk. The filename derivation also lines up with the runtime: since the registry lookup __private_workflows.get(workflowName) has to succeed, workflowName === workflowId, so the build-time moduleSpecifier matches what runWorkflow compiles under. Tests, comments, and the namespace-options refactor all look solid.

One tradeoff I'd like validated before merge (inline on runtime.ts), plus two smaller notes. Nothing blocking.

// (for stack-trace attribution); the builder passes that deduplicated set of
// filenames. When none are provided, fall back to a single representative
// filename so the bulk top-level parse is still done eagerly.
precompileWorkflowBundle(workflowCode, options?.workflowFilenames);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth validating against a multi-file benchmark. This eagerly compiles the full bundle once per workflow source file at module init — getCachedWorkflowScript does new Script(fullBundle, { filename }) per filename, and V8 keys its script compilation cache on the filename as well as the source, so there's no parse sharing across them (the existing script-cache.ts doc already notes "the whole bundle is compiled once per distinct filename").

The lazy path only ever compiled the filenames of workflows this process actually served. For an app with many workflow files where a given serverless instance only handles a subset, this front-loads — and increases total — cold-start parse work for workflows that may never run on this instance. The first-request win is real only if module init runs off that request's critical path on the platform; otherwise end-to-end latency for the first invocation could regress as the number of source files grows.

Does the benchmark cover an app with many distinct workflow source files (not just many functions in one file)? If not, that's the case I'd most want to see before merging.

* filename compiles the bulk of the bundle; the per-workflow filenames then
* recompile lazily (a cheap re-parse) on first replay.
*/
const PRECOMPILE_FALLBACK_FILENAME = '<workflow-bundle>';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fallback doesn't actually move any parse cost off the first replay. It caches a Script under <workflow-bundle>, but runWorkflow looks it up under the real moduleSpecifier, so the first replay still does a full new Script(...) under that real filename (different filename ⇒ full recompile, no reuse of the fallback entry). So the no-filenames path pays an extra full top-level parse at init for a Script that is never read, then parses again at replay — net overhead plus a dead cache entry, not a saving.

Since the builders now always pass workflowFilenames, this only affects manual/legacy callers, so it's low-impact. But consider either making the no-filenames case a no-op, or tightening the comment here and at lines 327-330 — both currently read as if the fallback warms the replay path, which it doesn't.

getQueueTopicPrefix('workflow', namespace);
const workflowFilenames = options?.workflowFilenames;
if (workflowFilenames && workflowFilenames.length > 0) {
const sorted = [...new Set(workflowFilenames)].sort();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor/nit: getWorkflowFilenamesFromManifest already returns a deduped, sorted array, so for the builder call sites this new Set(...).sort() is redundant work. It's harmless and reasonable as defensive normalization for direct callers of createWorkflowEntrypointOptionsCode — just flagging the double dedup/sort in case you'd rather pick one layer to own it.

Sign up for freeto 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

@TooTallNate@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); perf(core): precompile workflow vm.Script at module init by TooTallNate · Pull Request #2524 · vercel/workflow · GitHub
Skip to content

perf(core): precompile workflow vm.Script at module init - #2524

Open
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init
Open

perf(core): precompile workflow vm.Script at module init#2524
TooTallNate wants to merge 1 commit into
mainfrom
perf/script-precompile-module-init

Conversation

@TooTallNate

Copy link
Copy Markdown
Member

Summary

  • Precompile the workflow bundle's vm.Script at module-init time (when workflowEntrypoint is constructed) instead of lazily on the first queue delivery's replay, so the first replay is a cache hit rather than paying the bundle parse/compile on the critical path.
  • workflowEntrypoint gains an optional workflowFilenames option; the builders inline the deduplicated, sorted set of workflow source filenames into generated routes so the precompiled Script matches exactly what runWorkflow compiles under (parseWorkflowName(name)?.moduleSpecifier || name).
  • When no filenames are provided, the bundle is still precompiled once under a representative filename to pay the bulk top-level parse early.

Details

  • packages/core/src/vm/script-cache.ts: add precompileWorkflowScripts() (swallows compile errors so module init never breaks) and an isWorkflowScriptCached() test inspector.
  • packages/core/src/runtime.ts: workflowEntrypoint(workflowCode, { namespace?, workflowFilenames? }) warms the compiled-bundle cache at construction time.
  • packages/builders: getWorkflowFilenamesFromManifest() derives the per-file source filenames from the manifest's workflowIds; wired into all generated-route sites (base-builder workflow-only / combined / combined-watch, builder-deferred watch / production) via createWorkflowEntrypointOptionsCode({ workflowFilenames }).

Verified end-to-end against the example workbench: the generated flow route emits workflowEntrypoint(workflowCode, { workflowFilenames: [...] }) with the deduplicated, sorted filenames.

Testing

  • New unit tests: precompileWorkflowScripts (cache warming, identical-to-lazy Script, empty list, swallows syntax errors), createWorkflowEntrypointOptionsCode (filenames dedup/sort/combine), getWorkflowFilenamesFromManifest, and a workflowEntrypoint module-init precompile assertion.
  • @workflow/core and @workflow/builders build clean; affected test files pass.

Changeset

  • @workflow/core: minor (new workflowFilenames option + module-init precompile)
  • @workflow/builders, @workflow/next: patch (route wiring)

Compile the workflow bundle's `vm.Script` for each known workflow source
filename when `workflowEntrypoint` is constructed (module-init time),
rather than lazily on the first queue delivery's replay. Builders inline
the deduplicated, sorted set of workflow filenames into generated routes
via the new `workflowFilenames` entrypoint option, so the first replay is
a cache hit instead of paying the bundle parse/compile on the critical
path.
@TooTallNate
TooTallNate requested review from a team and ijjk as code ownersJune 18, 2026 21:36
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1ffc078

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

This PR includes changesets to release 16 packages
NameType
@workflow/buildersPatch
@workflow/nextPatch
@workflow/coreMinor
@workflow/astroPatch
@workflow/cliPatch
@workflow/nestPatch
@workflow/nitroPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/vitestPatch
workflowMinor
@workflow/web-sharedPatch
@workflow/webPatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production144022301672
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total8190210809272

❌ Failed Tests

▲ Vercel Production (2 failed)

astro (1 failed):

  • distributedAbortController - manual abort triggers signal | wrun_01KVEBJBCKBY07V9DFPPPE04VN | 🔍 observability

nextjs-turbopack (1 failed):

  • cancelRun via CLI - cancelling a running workflow | wrun_01KVEBB1EZ7BG88HYXXJCCJTXY | 🔍 observability

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro124127
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
❌ nextjs-turbopack14813
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.042s (-4.1%)1.006s (~)0.965s101.00x
💻 LocalNitro0.042s (+2.7%)1.005s (~)0.964s101.00x
💻 LocalNext.js (Turbopack)0.045s (-31.7% 🟢)1.005s (~)0.960s101.08x
🐘 PostgresExpress0.059s (-18.9% 🟢)1.012s (~)0.953s101.42x
🐘 PostgresNext.js (Turbopack)0.065s (-7.4% 🟢)1.012s (~)0.947s101.56x
🐘 PostgresNitro0.065s (+3.7%)1.013s (~)0.947s101.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.451s (+19.6% 🔺)2.595s (+13.1% 🔺)2.144s101.00x
▲ VercelNext.js (Turbopack)0.478s (+64.4% 🔺)2.473s (+30.7% 🔺)1.994s101.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.092s (+0.6%)2.005s (~)0.914s101.00x
💻 LocalExpress1.093s (-0.8%)2.006s (~)0.914s101.00x
🐘 PostgresNitro1.097s (-2.1%)2.008s (~)0.911s101.00x
🐘 PostgresExpress1.102s (~)2.010s (~)0.907s101.01x
💻 LocalNext.js (Turbopack)1.108s (-3.5%)2.006s (~)0.897s101.01x
🐘 PostgresNext.js (Turbopack)1.135s (-0.5%)2.009s (~)0.874s101.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.703s (-12.0% 🟢)3.912s (+6.4% 🔺)2.209s101.00x
▲ VercelNext.js (Turbopack)2.352s (+33.3% 🔺)4.394s (+18.4% 🔺)2.042s101.38x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.497s (~)11.016s (~)0.519s31.00x
🐘 PostgresNitro10.525s (~)11.018s (~)0.492s31.00x
💻 LocalNitro10.527s (~)11.023s (~)0.496s31.00x
💻 LocalExpress10.540s (~)11.023s (~)0.483s31.00x
💻 LocalNext.js (Turbopack)10.606s (-1.8%)11.021s (~)0.415s31.01x
🐘 PostgresNext.js (Turbopack)10.796s (-0.6%)11.018s (~)0.222s31.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)14.860s (+3.8%)16.723s (+2.6%)1.863s21.00x
▲ VercelExpress15.777s (-12.7% 🟢)17.890s (-10.4% 🟢)2.113s21.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.680s (-1.2%)14.019s (~)0.338s51.00x
💻 LocalExpress13.737s (~)14.027s (~)0.290s51.00x
🐘 PostgresNitro13.778s (~)14.017s (~)0.239s51.01x
💻 LocalNitro13.794s (+1.2%)14.027s (~)0.233s51.01x
💻 LocalNext.js (Turbopack)13.945s (-2.9%)14.024s (-6.7% 🟢)0.079s51.02x
🐘 PostgresNext.js (Turbopack)14.479s (~)15.019s (~)0.540s41.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.786s (-32.9% 🟢)25.665s (-30.3% 🟢)1.879s31.00x
▲ VercelExpress28.078s (+15.9% 🔺)30.151s (+15.2% 🔺)2.073s21.18x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express12.277s (-1.3%)13.017s (~)0.739s71.00x
💻 LocalNitro12.293s (+1.8%)13.024s (+1.0%)0.732s71.00x
🐘 PostgresNitro12.332s (-1.5%)13.016s (~)0.685s71.00x
💻 LocalExpress12.377s (-1.4%)13.026s (~)0.649s71.01x
💻 LocalNext.js (Turbopack)12.996s (-4.8%)13.453s (-4.1%)0.457s71.06x
🐘 PostgresNext.js (Turbopack)13.672s (-1.4%)14.022s (-1.0%)0.350s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.089s (-11.3% 🟢)33.544s (-9.1% 🟢)2.455s31.00x
▲ VercelNext.js (Turbopack)32.851s (-6.7% 🟢)35.009s (-5.2% 🟢)2.158s31.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.184s (-2.4%)2.007s (~)0.823s151.00x
🐘 PostgresNitro1.188s (-0.9%)2.007s (~)0.818s151.00x
💻 LocalExpress1.218s (+4.5%)2.006s (~)0.788s151.03x
💻 LocalNitro1.221s (+4.4%)2.007s (~)0.786s151.03x
🐘 PostgresNext.js (Turbopack)1.254s (-2.5%)2.008s (~)0.754s151.06x
💻 LocalNext.js (Turbopack)1.314s (+1.4%)2.006s (~)0.692s151.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.610s (+62.7% 🔺)5.619s (+44.6% 🔺)2.008s61.00x
▲ VercelNext.js (Turbopack)4.317s (+61.9% 🔺)6.102s (+48.9% 🔺)1.785s51.20x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.280s (-6.2% 🟢)2.007s (-20.0% 🟢)0.728s151.00x
🐘 PostgresExpress1.345s (-5.6% 🟢)2.008s (-16.1% 🟢)0.663s151.05x
🐘 PostgresNext.js (Turbopack)1.420s (-13.3% 🟢)2.007s (-16.1% 🟢)0.588s151.11x
💻 LocalExpress2.080s (+27.9% 🔺)2.592s (+29.2% 🔺)0.512s121.63x
💻 LocalNitro2.114s (+36.2% 🔺)3.009s (+49.6% 🔺)0.895s101.65x
💻 LocalNext.js (Turbopack)2.244s (+17.5% 🔺)2.825s (+23.2% 🔺)0.581s111.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.282s (+8.1% 🔺)6.113s (+7.8% 🔺)1.831s51.00x
▲ VercelNext.js (Turbopack)5.293s (+17.9% 🔺)7.023s (+8.4% 🔺)1.730s51.24x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.454s (-17.5% 🟢)3.209s (-17.4% 🟢)1.755s101.00x
🐘 PostgresNitro1.514s (-5.1% 🟢)3.454s (-13.9% 🟢)1.940s91.04x
🐘 PostgresNext.js (Turbopack)2.397s (-24.1% 🟢)3.211s (-25.4% 🟢)0.813s101.65x
💻 LocalNext.js (Turbopack)4.863s (-15.8% 🟢)5.510s (-11.4% 🟢)0.648s63.34x
💻 LocalNitro5.437s (+58.8% 🔺)6.016s (+50.0% 🔺)0.579s53.74x
💻 LocalExpress5.607s (+28.3% 🔺)6.014s (+23.6% 🔺)0.406s63.86x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.175s (-6.0% 🟢)6.691s (-15.6% 🟢)1.516s51.00x
▲ VercelNext.js (Turbopack)5.635s (~)7.580s (-1.8%)1.945s41.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.188s (-2.4%)2.008s (~)0.820s151.00x
💻 LocalNitro1.233s (+2.7%)2.006s (~)0.773s151.04x
💻 LocalExpress1.234s (-21.7% 🟢)2.006s (~)0.772s151.04x
🐘 PostgresNext.js (Turbopack)1.252s (-2.2%)2.006s (~)0.754s151.05x
🐘 PostgresNitro1.255s (+3.6%)2.008s (~)0.753s151.06x
💻 LocalNext.js (Turbopack)1.356s (-3.1%)2.006s (~)0.650s151.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.577s (+54.0% 🔺)5.261s (+38.3% 🔺)1.684s61.00x
▲ VercelNext.js (Turbopack)3.682s (-1.0%)5.338s (+2.1%)1.656s61.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.288s (-5.7% 🟢)2.007s (-13.3% 🟢)0.720s151.00x
🐘 PostgresNitro1.304s (-9.6% 🟢)2.006s (-16.2% 🟢)0.702s151.01x
🐘 PostgresNext.js (Turbopack)1.421s (-7.9% 🟢)2.007s (-9.7% 🟢)0.586s151.10x
💻 LocalExpress2.015s (+6.2% 🔺)2.736s (+27.3% 🔺)0.720s111.57x
💻 LocalNitro2.098s (+23.9% 🔺)2.827s (+40.7% 🔺)0.728s111.63x
💻 LocalNext.js (Turbopack)2.189s (+0.9%)2.733s (-9.1% 🟢)0.545s111.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.608s (-19.2% 🟢)5.326s (-13.5% 🟢)1.718s61.00x
▲ VercelExpress3.823s (+40.3% 🔺)5.641s (+23.4% 🔺)1.818s61.06x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.434s (-20.5% 🟢)3.885s (-9.6% 🟢)2.451s81.00x
🐘 PostgresExpress1.505s (-16.4% 🟢)3.761s (-6.2% 🟢)2.256s81.05x
🐘 PostgresNext.js (Turbopack)2.441s (-40.0% 🟢)3.210s (-27.8% 🟢)0.769s101.70x
💻 LocalNext.js (Turbopack)5.325s (-8.3% 🟢)6.013s (-6.3% 🟢)0.688s53.71x
💻 LocalNitro5.552s (+23.6% 🔺)6.015s (+20.0% 🔺)0.463s63.87x
💻 LocalExpress5.867s (+27.8% 🔺)6.350s (+26.7% 🔺)0.483s64.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.865s (-42.3% 🟢)6.596s (-35.6% 🟢)1.731s51.00x
▲ VercelNext.js (Turbopack)6.204s (+64.0% 🔺)8.242s (+57.5% 🔺)2.038s41.28x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.528s (-11.1% 🟢)1.006s (-3.3%)0.478s601.00x
💻 LocalNitro0.563s (+12.6% 🔺)1.005s (~)0.442s601.07x
🐘 PostgresExpress0.572s (~)1.023s (+1.7%)0.450s591.08x
💻 LocalExpress0.606s (-3.0%)1.005s (-1.6%)0.399s601.15x
💻 LocalNext.js (Turbopack)0.701s (-21.0% 🟢)1.004s (-3.4%)0.303s601.33x
🐘 PostgresNext.js (Turbopack)0.785s (-6.1% 🟢)1.006s (-1.7%)0.221s601.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.871s (-22.8% 🟢)6.946s (-14.7% 🟢)2.074s91.00x
▲ VercelExpress5.110s (+12.4% 🔺)7.398s (+14.2% 🔺)2.287s91.05x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (-9.2% 🟢)2.052s (+1.1%)0.792s451.00x
🐘 PostgresExpress1.290s (-4.9%)2.030s (~)0.740s451.02x
💻 LocalNitro1.403s (+18.1% 🔺)2.006s (~)0.604s451.11x
💻 LocalExpress1.462s (-1.8%)2.006s (~)0.545s451.16x
💻 LocalNext.js (Turbopack)1.790s (-14.8% 🟢)2.005s (-33.3% 🟢)0.216s451.42x
🐘 PostgresNext.js (Turbopack)1.829s (-5.8% 🟢)2.030s (-2.2%)0.201s451.45x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.122s (-36.4% 🟢)13.375s (-30.2% 🟢)2.253s71.00x
▲ VercelNext.js (Turbopack)11.452s (-15.8% 🟢)13.422s (-12.4% 🟢)1.971s71.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.498s (-10.7% 🟢)3.033s (-4.2%)0.535s401.00x
🐘 PostgresExpress2.538s (-6.4% 🟢)3.033s (-2.5%)0.495s401.02x
💻 LocalNitro3.063s (+12.2% 🔺)3.626s (+12.5% 🔺)0.564s341.23x
💻 LocalExpress3.206s (~)4.009s (~)0.804s301.28x
🐘 PostgresNext.js (Turbopack)3.697s (-4.4%)4.009s (-1.6%)0.313s301.48x
💻 LocalNext.js (Turbopack)3.828s (-11.9% 🟢)4.146s (-17.2% 🟢)0.318s291.53x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.676s (-16.9% 🟢)24.156s (-13.8% 🟢)2.480s61.00x
▲ VercelNext.js (Turbopack)23.635s (-5.4% 🟢)25.770s (-3.8%)2.134s51.09x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.216s (-8.1% 🟢)1.006s (~)0.789s601.00x
🐘 PostgresExpress0.221s (-4.5%)1.006s (~)0.785s601.02x
🐘 PostgresNext.js (Turbopack)0.261s (-11.3% 🟢)1.006s (~)0.745s601.21x
💻 LocalNitro0.428s (+14.9% 🔺)1.005s (~)0.576s601.98x
💻 LocalExpress0.430s (-2.2%)1.005s (~)0.574s601.99x
💻 LocalNext.js (Turbopack)0.559s (-4.0%)1.004s (~)0.445s602.58x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.453s (+58.2% 🔺)4.282s (+49.3% 🔺)1.830s151.00x
▲ VercelNext.js (Turbopack)2.537s (+35.5% 🔺)4.323s (+11.2% 🔺)1.787s141.03x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.314s (-11.6% 🟢)1.006s (-3.3%)0.692s901.00x
🐘 PostgresNitro0.325s (-5.0%)1.017s (~)0.692s891.04x
🐘 PostgresNext.js (Turbopack)0.435s (-19.2% 🟢)1.006s (-10.0% 🟢)0.571s901.39x
💻 LocalNitro2.092s (+37.3% 🔺)2.537s (+17.9% 🔺)0.444s366.66x
💻 LocalExpress2.133s (+2.1%)2.581s (-2.8%)0.448s356.79x
💻 LocalNext.js (Turbopack)2.357s (+1.1%)3.010s (-2.1%)0.653s307.50x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.706s (-7.5% 🟢)4.760s (-0.8%)2.054s201.00x
▲ VercelNext.js (Turbopack)3.147s (+3.4%)4.862s (+1.5%)1.715s191.16x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.517s (-9.0% 🟢)1.059s (-14.1% 🟢)0.542s1141.00x
🐘 PostgresExpress0.517s (-9.1% 🟢)1.107s (-9.0% 🟢)0.590s1091.00x
🐘 PostgresNext.js (Turbopack)1.665s (-36.4% 🟢)2.403s (-30.8% 🟢)0.738s513.22x
💻 LocalNext.js (Turbopack)9.274s (-13.8% 🟢)10.192s (-11.9% 🟢)0.918s1217.94x
💻 LocalExpress10.126s (+21.9% 🔺)10.779s (+21.4% 🔺)0.653s1219.59x
💻 LocalNitro10.299s (+63.2% 🔺)10.945s (+62.3% 🔺)0.646s1219.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.010s (-26.6% 🟢)6.009s (-15.2% 🟢)1.998s201.00x
▲ VercelNext.js (Turbopack)5.104s (+5.4% 🔺)6.996s (+7.1% 🔺)1.892s181.27x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.157s (-1.8%)1.999s (~)0.001s (-18.2% 🟢)2.010s (~)0.853s101.00x
🐘 PostgresNitro1.164s (~)1.999s (~)0.001s (+20.0% 🔺)2.010s (~)0.847s101.01x
💻 LocalNitro1.167s (+4.4%)2.006s (~)0.012s (-55.4% 🟢)2.020s (-0.9%)0.853s101.01x
💻 LocalExpress1.170s (+1.7%)2.005s (~)0.012s (+20.8% 🔺)2.020s (~)0.850s101.01x
💻 LocalNext.js (Turbopack)1.184s (-2.2%)2.002s (~)0.008s (-36.0% 🟢)2.014s (~)0.830s101.02x
🐘 PostgresNext.js (Turbopack)1.217s (-1.0%)2.001s (~)0.001s (-30.8% 🟢)2.010s (~)0.793s101.05x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.670s (+5.9% 🔺)3.838s (~)4.711s (+483.4% 🔺)9.069s (+78.4% 🔺)6.399s101.00x
▲ VercelExpress2.901s (+20.8% 🔺)4.452s (+21.0% 🔺)4.320s (+483.0% 🔺)9.303s (+90.8% 🔺)6.401s101.09x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.552s (-2.0%)2.003s (~)0.005s (+11.4% 🔺)2.026s (~)0.474s301.00x
🐘 PostgresNitro1.566s (-0.8%)2.005s (~)0.005s (-9.9% 🟢)2.026s (~)0.460s301.01x
💻 LocalNitro1.568s (+9.1% 🔺)2.011s (~)0.014s (-24.0% 🟢)2.026s (~)0.458s301.01x
💻 LocalExpress1.588s (+1.4%)2.010s (~)0.011s (-13.7% 🟢)2.023s (~)0.435s301.02x
💻 LocalNext.js (Turbopack)1.614s (-7.8% 🟢)2.008s (~)0.012s (-5.7% 🟢)2.022s (~)0.408s301.04x
🐘 PostgresNext.js (Turbopack)1.755s (-1.7%)2.010s (~)0.005s (-0.6%)2.025s (~)0.269s301.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.320s (+30.3% 🔺)10.378s (+32.9% 🔺)0.371s (+107.3% 🔺)11.213s (+32.6% 🔺)2.892s61.00x
▲ VercelNext.js (Turbopack)8.347s (-1.7%)10.004s (+1.9%)0.488s (+85.4% 🔺)10.955s (+3.6%)2.608s61.00x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.737s (-4.7%)1.064s (+1.5%)0.000s (+96.4% 🔺)1.086s (-0.7%)0.349s561.00x
🐘 PostgresExpress0.754s (-1.3%)1.046s (+2.1%)0.000s (-50.0% 🟢)1.060s (~)0.306s571.02x
🐘 PostgresNext.js (Turbopack)0.916s (-10.2% 🟢)1.250s (-14.6% 🟢)0.000s (-57.3% 🟢)1.257s (-14.6% 🟢)0.341s481.24x
💻 LocalNext.js (Turbopack)1.433s (-5.3% 🟢)1.917s (-4.8%)0.000s (-37.5% 🟢)1.919s (-4.8%)0.486s321.95x
💻 LocalNitro1.451s (+34.9% 🔺)2.014s (+9.6% 🔺)0.000s (-52.9% 🟢)2.016s (+9.6% 🔺)0.566s301.97x
💻 LocalExpress1.572s (+15.4% 🔺)2.014s (~)0.000s (~)2.016s (~)0.444s302.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.647s (+34.8% 🔺)6.077s (+27.4% 🔺)0.000s (+20.0% 🔺)6.573s (+24.9% 🔺)1.926s101.00x
▲ VercelExpress5.355s (+76.7% 🔺)6.649s (+45.7% 🔺)0.000s (+Infinity% 🔺)7.225s (+43.4% 🔺)1.869s91.15x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.446s (-10.4% 🟢)2.100s (+1.8%)0.000s (NaN%)2.120s (+1.5%)0.674s291.00x
🐘 PostgresNitro1.601s (+3.2%)2.172s (+1.8%)0.000s (-100.0% 🟢)2.194s (+2.2%)0.593s281.11x
🐘 PostgresNext.js (Turbopack)2.201s (+4.3%)2.609s (+0.8%)0.000s (-100.0% 🟢)2.618s (+0.8%)0.417s231.52x
💻 LocalNext.js (Turbopack)3.608s (+24.4% 🔺)4.283s (+27.6% 🔺)0.001s (+126.7% 🔺)4.295s (+27.7% 🔺)0.688s152.49x
💻 LocalNitro3.665s (+66.1% 🔺)4.310s (+57.2% 🔺)0.001s (-10.2% 🟢)4.321s (+56.9% 🔺)0.656s142.53x
💻 LocalExpress4.419s (+50.8% 🔺)4.870s (+32.7% 🔺)0.000s (+4.6%)4.880s (+32.8% 🔺)0.461s133.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.466s (+13.6% 🔺)7.920s (+9.6% 🔺)0.000s (+Infinity% 🔺)8.414s (+9.4% 🔺)1.949s81.00x
▲ VercelNext.js (Turbopack)6.901s (-4.8%)8.409s (~)0.013s (+10071.4% 🔺)8.839s (~)1.938s71.07x
▲ VercelNitro⚠️missing-----

🔍 Observability: Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresExpress12/21
▲ VercelExpress15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres19/21
Next.js (Turbopack)🐘 Postgres12/21
Nitro🐘 Postgres17/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


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the full diff, built @workflow/core + @workflow/builders clean, and ran the affected tests (script-cache, runtime, constants, get-workflow-filenames) locally — all green.

The design is nicely fail-safe: workflowFilenames is best-effort, and a wrong/missing/extra filename only ever degrades to a cache miss → lazy compile (exactly today's behavior), with no determinism or correctness risk. The filename derivation also lines up with the runtime: since the registry lookup __private_workflows.get(workflowName) has to succeed, workflowName === workflowId, so the build-time moduleSpecifier matches what runWorkflow compiles under. Tests, comments, and the namespace-options refactor all look solid.

One tradeoff I'd like validated before merge (inline on runtime.ts), plus two smaller notes. Nothing blocking.

// (for stack-trace attribution); the builder passes that deduplicated set of
// filenames. When none are provided, fall back to a single representative
// filename so the bulk top-level parse is still done eagerly.
precompileWorkflowBundle(workflowCode, options?.workflowFilenames);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth validating against a multi-file benchmark. This eagerly compiles the full bundle once per workflow source file at module init — getCachedWorkflowScript does new Script(fullBundle, { filename }) per filename, and V8 keys its script compilation cache on the filename as well as the source, so there's no parse sharing across them (the existing script-cache.ts doc already notes "the whole bundle is compiled once per distinct filename").

The lazy path only ever compiled the filenames of workflows this process actually served. For an app with many workflow files where a given serverless instance only handles a subset, this front-loads — and increases total — cold-start parse work for workflows that may never run on this instance. The first-request win is real only if module init runs off that request's critical path on the platform; otherwise end-to-end latency for the first invocation could regress as the number of source files grows.

Does the benchmark cover an app with many distinct workflow source files (not just many functions in one file)? If not, that's the case I'd most want to see before merging.

* filename compiles the bulk of the bundle; the per-workflow filenames then
* recompile lazily (a cheap re-parse) on first replay.
*/
const PRECOMPILE_FALLBACK_FILENAME = '<workflow-bundle>';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fallback doesn't actually move any parse cost off the first replay. It caches a Script under <workflow-bundle>, but runWorkflow looks it up under the real moduleSpecifier, so the first replay still does a full new Script(...) under that real filename (different filename ⇒ full recompile, no reuse of the fallback entry). So the no-filenames path pays an extra full top-level parse at init for a Script that is never read, then parses again at replay — net overhead plus a dead cache entry, not a saving.

Since the builders now always pass workflowFilenames, this only affects manual/legacy callers, so it's low-impact. But consider either making the no-filenames case a no-op, or tightening the comment here and at lines 327-330 — both currently read as if the fallback warms the replay path, which it doesn't.

getQueueTopicPrefix('workflow', namespace);
const workflowFilenames = options?.workflowFilenames;
if (workflowFilenames && workflowFilenames.length > 0) {
const sorted = [...new Set(workflowFilenames)].sort();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor/nit: getWorkflowFilenamesFromManifest already returns a deduped, sorted array, so for the builder call sites this new Set(...).sort() is redundant work. It's harmless and reasonable as defensive normalization for direct callers of createWorkflowEntrypointOptionsCode — just flagging the double dedup/sort in case you'd rather pick one layer to own it.

Sign up for freeto 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

@TooTallNate@pranaygp