Skip to content

fix(builders) - support explicit project roots in swc transforms#1399

Open
AndrewBarba wants to merge 6 commits intomainfrom
barba/codex/builder-explicit-project-root
Open

fix(builders) - support explicit project roots in swc transforms#1399
AndrewBarba wants to merge 6 commits intomainfrom
barba/codex/builder-explicit-project-root

Conversation

@AndrewBarba
Copy link

@AndrewBarba AndrewBarba commented Mar 16, 2026

Summary

  • add an optional projectRoot to builder config so SWC/module-specifier resolution does not have to rely on global cwd
  • thread that root through discovery, SWC transforms, and the Next deferred builder while preserving existing defaults
  • add focused builders tests that prove workspace package ids can be resolved from a consuming app root

Why

[secret framework] currently has to temporarily mutate process.cwd() when invoking Workflow builders so package-owned workflows resolve to stable package ids from the app root. This change makes that root explicit and keeps the current behavior as the fallback when projectRoot is omitted.

Validation

  • pnpm exec vitest run packages/builders/src/module-specifier.test.ts packages/builders/src/swc-esbuild-plugin.test.ts packages/builders/src/discover-entries-esbuild-plugin.test.ts
  • pnpm --filter @workflow/builders typecheck
  • pnpm --filter @workflow/builders build
  • pnpm --filter @workflow/next build

@AndrewBarba AndrewBarba requested review from a team and ijjk as code owners March 16, 2026 16:49
@changeset-bot
Copy link

changeset-bot bot commented Mar 16, 2026

⚠️ No Changeset found

Latest commit: aa23b32

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

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

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link
Contributor

vercel bot commented Mar 16, 2026

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

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Mar 18, 2026 8:48pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Mar 18, 2026 8:48pm
example-workflow Ready Ready Preview, Comment Mar 18, 2026 8:48pm
workbench-astro-workflow Ready Ready Preview, Comment Mar 18, 2026 8:48pm
workbench-express-workflow Ready Ready Preview, Comment Mar 18, 2026 8:48pm
workbench-fastify-workflow Ready Ready Preview, Comment Mar 18, 2026 8:48pm
workbench-hono-workflow Ready Ready Preview, Comment Mar 18, 2026 8:48pm
workbench-nitro-workflow Ready Ready Preview, Comment Mar 18, 2026 8:48pm
workbench-nuxt-workflow Ready Ready Preview, Comment Mar 18, 2026 8:48pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Mar 18, 2026 8:48pm
workbench-vite-workflow Ready Ready Preview, Comment Mar 18, 2026 8:48pm
workflow-docs Ready Ready Preview, Comment, Open in v0 Mar 18, 2026 8:48pm
workflow-nest Ready Ready Preview, Comment Mar 18, 2026 8:48pm
workflow-swc-playground Ready Ready Preview, Comment Mar 18, 2026 8:48pm

@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ ▲ Vercel Production 757 1 67 825
✅ 💻 Local Development 782 0 118 900
✅ 📦 Local Production 782 0 118 900
✅ 🐘 Local Postgres 782 0 118 900
✅ 🪟 Windows 72 0 3 75
❌ 🌍 Community Worlds 118 56 15 189
✅ 📋 Other 198 0 27 225
Total 3491 57 466 4014

❌ Failed Tests

▲ Vercel Production (1 failed)

sveltekit (1 failed):

🌍 Community Worlds (56 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM1B99EJ4182VTA1BBEQEQCQ
  • webhookWorkflow | wrun_01KM1B9KTJC6S33KRBYBMK2NGW
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM1BF1GDX0FX6ST33J2PA7PV

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM1B99EJ4182VTA1BBEQEQCQ
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM1BF1GDX0FX6ST33J2PA7PV

turso (51 failed):

  • addTenWorkflow | wrun_01KM1B84XW64PNSQV8T3HN4YPA
  • addTenWorkflow | wrun_01KM1B84XW64PNSQV8T3HN4YPA
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KM1BA5Z91MNM7S8AMSK7DGNA
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KM1B8BD4B66C8WGC097BNBF4
  • promiseRaceWorkflow | wrun_01KM1B8FP7SDMSXN3H3SQKM5V7
  • promiseAnyWorkflow | wrun_01KM1B8JKKWRNRXPKGQKBJZ8NT
  • importedStepOnlyWorkflow | wrun_01KM1BAKJJXPJZAG0K4HXPC47E
  • hookWorkflow | wrun_01KM1B8YRRXD6GDCS8ZNBAGYZR
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM1B99EJ4182VTA1BBEQEQCQ
  • webhookWorkflow | wrun_01KM1B9KTJC6S33KRBYBMK2NGW
  • sleepingWorkflow | wrun_01KM1B9T1JC5PFX30P9KNSC5WK
  • parallelSleepWorkflow | wrun_01KM1BA6FYH2YSRJ92NGQ8TT9E
  • nullByteWorkflow | wrun_01KM1BA9NSMQ1SJXYB2XX1APM0
  • workflowAndStepMetadataWorkflow | wrun_01KM1BABYAV7H8VMG8RWGHWQN4
  • fetchWorkflow | wrun_01KM1BB8CKF5XD9028YSD6F5CP
  • promiseRaceStressTestWorkflow | wrun_01KM1BBBPXFM5458RDADDH0TPA
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KM1BEDGMMEYEDD0TZ40TAERA
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM1BF1GDX0FX6ST33J2PA7PV
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KM1BFP3A624PJAJK52Y5QT50
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KM1BG97DMKC2SVPTK3RZVC2J
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KM1BGJ1ACNCCTZ4DQ20GB7GE
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KM1BGQE9EB674KY54009Q0KW
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KM1BGTWW3ANJPXX370S8HV2G
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KM1BHA2H6A8WEST77Q0FQT66
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KM1BHFQCC37XEEGMHKBQJBJP
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KM1BHR35KDEJCYQXNEX3Y37C
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KM1BHYJQ5HWEG1YB51T5ECDY
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KM1BJ50KSGFAY0GH686BHS2Q
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KM1BJVKK2QDCQ9EMA62X6EQ1
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KM1BK238J6MBY617B0T0YS3R
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KM1BKBB9EPAFC2F3F8PMQ86J
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KM1BKJRPSR63GRBMBGEMEKHM
  • cancelRun - cancelling a running workflow | wrun_01KM1BKS5J1CB08MNG5MGH1JC0
  • cancelRun via CLI - cancelling a running workflow | wrun_01KM1BM29PYEJEXJG21JX5KJKV
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep | wrun_01KM1BME9GXPY98C8YHJK4D06F
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KM1BN3HJD3SAW2FXQ4C6A70N
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KM1BNEF2ZVC32MTGFFQC0BZF

Details by Category

❌ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 68 0 7
✅ example 68 0 7
✅ express 68 0 7
✅ fastify 68 0 7
✅ hono 68 0 7
✅ nextjs-turbopack 73 0 2
✅ nextjs-webpack 73 0 2
✅ nitro 68 0 7
✅ nuxt 68 0 7
❌ sveltekit 67 1 7
✅ vite 68 0 7
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 66 0 9
✅ express-stable 66 0 9
✅ fastify-stable 66 0 9
✅ hono-stable 66 0 9
✅ nextjs-turbopack-canary 55 0 20
✅ nextjs-turbopack-stable 72 0 3
✅ nextjs-webpack-canary 55 0 20
✅ nextjs-webpack-stable 72 0 3
✅ nitro-stable 66 0 9
✅ nuxt-stable 66 0 9
✅ sveltekit-stable 66 0 9
✅ vite-stable 66 0 9
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 66 0 9
✅ express-stable 66 0 9
✅ fastify-stable 66 0 9
✅ hono-stable 66 0 9
✅ nextjs-turbopack-canary 55 0 20
✅ nextjs-turbopack-stable 72 0 3
✅ nextjs-webpack-canary 55 0 20
✅ nextjs-webpack-stable 72 0 3
✅ nitro-stable 66 0 9
✅ nuxt-stable 66 0 9
✅ sveltekit-stable 66 0 9
✅ vite-stable 66 0 9
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 66 0 9
✅ express-stable 66 0 9
✅ fastify-stable 66 0 9
✅ hono-stable 66 0 9
✅ nextjs-turbopack-canary 55 0 20
✅ nextjs-turbopack-stable 72 0 3
✅ nextjs-webpack-canary 55 0 20
✅ nextjs-webpack-stable 72 0 3
✅ nitro-stable 66 0 9
✅ nuxt-stable 66 0 9
✅ sveltekit-stable 66 0 9
✅ vite-stable 66 0 9
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 72 0 3
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 2
❌ mongodb 52 3 3
✅ redis-dev 3 0 2
❌ redis 53 2 3
✅ turso-dev 3 0 2
❌ turso 4 51 3
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 66 0 9
✅ e2e-local-postgres-nest-stable 66 0 9
✅ e2e-local-prod-nest-stable 66 0 9

📋 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
Copy link
Contributor

github-actions bot commented Mar 16, 2026

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 0.043s (~) 1.005s (~) 0.962s 10 1.00x
💻 Local Nitro 0.047s (~) 1.005s (~) 0.958s 10 1.10x
🐘 Postgres Nitro 0.058s (-5.7% 🟢) 1.010s (~) 0.952s 10 1.35x
🐘 Postgres Express 0.064s (+6.9% 🔺) 1.012s (~) 0.948s 10 1.48x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 0.402s (-16.1% 🟢) 1.865s (-28.2% 🟢) 1.463s 10 1.00x
▲ Vercel Nitro 0.488s (+10.9% 🔺) 2.394s (+11.3% 🔺) 1.906s 10 1.21x
▲ Vercel Next.js (Turbopack) 0.974s (+127.6% 🔺) 2.930s (+26.2% 🔺) 1.955s 10 2.42x

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

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.131s (~) 2.005s (~) 0.874s 10 1.00x
💻 Local Express 1.133s (~) 2.006s (~) 0.874s 10 1.00x
🐘 Postgres Nitro 1.141s (~) 2.012s (~) 0.870s 10 1.01x
🐘 Postgres Express 1.151s (-0.8%) 2.012s (~) 0.861s 10 1.02x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.026s (-3.9%) 3.834s (+11.7% 🔺) 1.809s 10 1.00x
▲ Vercel Express 2.047s (-3.5%) 3.252s (-10.8% 🟢) 1.205s 10 1.01x
▲ Vercel Next.js (Turbopack) 2.093s (-9.0% 🟢) 3.930s (+12.2% 🔺) 1.837s 10 1.03x

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

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 10.912s (~) 11.022s (~) 0.110s 3 1.00x
🐘 Postgres Nitro 10.916s (-0.8%) 11.038s (~) 0.122s 3 1.00x
💻 Local Nitro 10.929s (~) 11.023s (~) 0.094s 3 1.00x
🐘 Postgres Express 10.950s (~) 11.041s (~) 0.091s 3 1.00x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 16.623s (-5.1% 🟢) 17.430s (-10.7% 🟢) 0.807s 2 1.00x
▲ Vercel Nitro 16.762s (-3.7%) 20.356s (+10.8% 🔺) 3.594s 2 1.01x
▲ Vercel Next.js (Turbopack) 18.777s (+1.4%) 20.785s (+6.0% 🔺) 2.008s 2 1.13x

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

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 27.190s (~) 28.057s (~) 0.867s 3 1.00x
🐘 Postgres Express 27.211s (~) 28.060s (~) 0.848s 3 1.00x
💻 Local Express 27.485s (~) 28.050s (~) 0.565s 3 1.01x
💻 Local Nitro 27.494s (~) 28.052s (~) 0.558s 3 1.01x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 43.303s (-3.6%) 45.007s (-2.3%) 1.704s 2 1.00x
▲ Vercel Express 45.793s (-1.6%) 47.542s (-2.1%) 1.749s 2 1.06x
▲ Vercel Next.js (Turbopack) 48.337s (+4.7%) 49.925s (+5.3% 🔺) 1.588s 2 1.12x

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

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 54.278s (~) 55.093s (~) 0.815s 2 1.00x
🐘 Postgres Express 54.429s (~) 55.108s (~) 0.679s 2 1.00x
💻 Local Express 56.508s (~) 57.100s (~) 0.591s 2 1.04x
💻 Local Nitro 56.545s (~) 57.106s (~) 0.560s 2 1.04x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 93.025s (-5.7% 🟢) 94.721s (-4.9%) 1.696s 1 1.00x
▲ Vercel Next.js (Turbopack) 97.607s (-6.1% 🟢) 98.558s (-6.0% 🟢) 0.951s 1 1.05x
▲ Vercel Express 97.717s (-0.7%) 98.444s (-1.7%) 0.727s 1 1.05x

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

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.274s (-1.8%) 2.010s (~) 0.736s 15 1.00x
🐘 Postgres Express 1.291s (+1.0%) 2.011s (~) 0.721s 15 1.01x
💻 Local Express 1.533s (+1.5%) 2.005s (~) 0.472s 15 1.20x
💻 Local Nitro 1.555s (+3.2%) 2.005s (~) 0.451s 15 1.22x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.276s (-12.0% 🟢) 3.811s (-9.4% 🟢) 1.535s 8 1.00x
▲ Vercel Next.js (Turbopack) 2.636s (-10.1% 🟢) 4.135s (+3.2%) 1.499s 8 1.16x
▲ Vercel Nitro 2.832s (+16.2% 🔺) 4.177s (+6.8% 🔺) 1.345s 8 1.24x

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

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 2.458s (~) 3.014s (~) 0.556s 10 1.00x
🐘 Postgres Nitro 2.467s (~) 3.013s (~) 0.546s 10 1.00x
💻 Local Nitro 2.913s (-2.6%) 3.341s (~) 0.428s 9 1.19x
💻 Local Express 2.917s (+2.2%) 3.208s (+6.6% 🔺) 0.291s 10 1.19x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.524s (-1.7%) 4.096s (+9.0% 🔺) 1.572s 8 1.00x
▲ Vercel Express 2.716s (+8.7% 🔺) 4.019s (+1.3%) 1.304s 8 1.08x
▲ Vercel Next.js (Turbopack) 2.983s (+5.7% 🔺) 5.102s (+30.0% 🔺) 2.119s 6 1.18x

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

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 3.617s (~) 4.013s (~) 0.396s 8 1.00x
🐘 Postgres Express 3.622s (+0.8%) 4.014s (~) 0.392s 8 1.00x
💻 Local Express 8.137s (+2.3%) 8.771s (+6.0% 🔺) 0.634s 4 2.25x
💻 Local Nitro 8.879s (+12.5% 🔺) 9.274s (+5.7% 🔺) 0.395s 4 2.45x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.822s (-15.9% 🟢) 4.212s (-11.5% 🟢) 1.390s 8 1.00x
▲ Vercel Express 2.882s (-6.2% 🟢) 4.161s (-3.8%) 1.279s 8 1.02x
▲ Vercel Next.js (Turbopack) 3.670s (+6.7% 🔺) 6.437s (+36.3% 🔺) 2.767s 5 1.30x

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

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.272s (-1.3%) 2.011s (~) 0.738s 15 1.00x
🐘 Postgres Express 1.283s (+1.9%) 2.011s (~) 0.728s 15 1.01x
💻 Local Express 1.519s (~) 2.005s (~) 0.486s 15 1.19x
💻 Local Nitro 1.594s (+3.4%) 2.006s (~) 0.412s 15 1.25x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.236s (-13.5% 🟢) 3.991s (-1.1%) 1.755s 8 1.00x
▲ Vercel Express 2.388s (+8.1% 🔺) 3.814s (+8.6% 🔺) 1.426s 8 1.07x
▲ Vercel Nitro 2.409s (+8.6% 🔺) 3.786s (+5.6% 🔺) 1.378s 8 1.08x

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

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 2.425s (-1.5%) 3.012s (~) 0.587s 10 1.00x
🐘 Postgres Express 2.447s (~) 3.011s (~) 0.565s 10 1.01x
💻 Local Nitro 2.867s (-8.0% 🟢) 3.454s (-11.1% 🟢) 0.587s 9 1.18x
💻 Local Express 2.968s (+0.8%) 3.760s (+13.7% 🔺) 0.792s 8 1.22x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.855s (+14.6% 🔺) 4.131s (+12.7% 🔺) 1.276s 8 1.00x
▲ Vercel Next.js (Turbopack) 2.865s (+13.8% 🔺) 4.334s (+24.9% 🔺) 1.469s 7 1.00x
▲ Vercel Express 3.118s (+24.3% 🔺) 4.831s (+26.9% 🔺) 1.713s 7 1.09x

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

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 3.584s (-0.6%) 4.014s (~) 0.430s 8 1.00x
🐘 Postgres Nitro 3.604s (~) 4.013s (~) 0.409s 8 1.01x
💻 Local Express 8.409s (-1.7%) 9.019s (~) 0.611s 4 2.35x
💻 Local Nitro 8.523s (-1.2%) 9.021s (~) 0.498s 4 2.38x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.546s (-13.4% 🟢) 3.909s (-9.5% 🟢) 1.363s 8 1.00x
▲ Vercel Nitro 2.567s (-14.9% 🟢) 4.312s (-1.6%) 1.745s 8 1.01x
▲ Vercel Next.js (Turbopack) 3.325s (-16.5% 🟢) 5.181s (+3.7%) 1.857s 7 1.31x

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

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 0.197s (~) 1.003s (~) 0.011s (+1.8%) 1.017s (~) 0.820s 10 1.00x
💻 Local Nitro 0.204s (+1.6%) 1.003s (~) 0.011s (-3.4%) 1.017s (~) 0.813s 10 1.03x
🐘 Postgres Nitro 0.225s (~) 0.995s (~) 0.002s (+28.6% 🔺) 1.014s (~) 0.788s 10 1.14x
🐘 Postgres Express 0.227s (+3.8%) 0.997s (+0.5%) 0.002s (+25.0% 🔺) 1.014s (~) 0.787s 10 1.15x
💻 Local Next.js (Turbopack) ⚠️ missing - - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 1.554s (-10.3% 🟢) 2.916s (+1.1%) 0.346s (+5671.7% 🔺) 3.663s (+3.6%) 2.109s 10 1.00x
▲ Vercel Nitro 1.605s (+4.4%) 3.248s (+17.4% 🔺) 0.004s (-70.8% 🟢) 3.810s (+12.5% 🔺) 2.205s 10 1.03x
▲ Vercel Next.js (Turbopack) 1.611s (-1.6%) 2.991s (+3.8%) 0.006s (+10.9% 🔺) 3.514s (+5.8% 🔺) 1.903s 10 1.04x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Express 9/12
🐘 Postgres Nitro 10/12
▲ Vercel Nitro 6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 6/12
Next.js (Turbopack) ▲ Vercel 12/12
Nitro 🐘 Postgres 7/12
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)

📋 View full workflow run

'workflow',
workflowFile
workflowFile,
this.config.projectRoot || this.config.workingDir
Copy link
Member

Choose a reason for hiding this comment

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

Could maybe piggy back off of https://github.com/vercel/next.js/blob/canary/packages/next/src/server/config-shared.ts#L1668 if set by the user so doesn't need to set both

Copy link
Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

@pranaygp pranaygp left a comment

Choose a reason for hiding this comment

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

@ijjk left a comment for code reuse but otherwise looks good

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants