Skip to content

Add World.close() for clean resource cleanup in CLI and short-lived processes#1081

Merged
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface
Feb 17, 2026
Merged

Add World.close() for clean resource cleanup in CLI and short-lived processes#1081
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface

Conversation

@TooTallNate
Copy link
Copy Markdown
Member

@TooTallNate TooTallNate commented Feb 16, 2026

Added a close() method to the World interface and implemented it across world implementations to ensure clean process exits without relying on process.exit().

What changed?

  • Added an optional close() method to the World interface for releasing resources
  • Implemented close() in world-local to close the undici HTTP agent
  • Implemented close() in world-postgres to stop PgBoss and close the postgres connection pool
  • Enhanced the CLI's BaseCommand to call World.close() after commands complete
  • Refactored the HTTP agent in world-local from a module-level singleton to an instance-scoped resource
  • Added an E2E test for the CLI cancel command to verify the clean exit path

How to test?

  1. Run CLI commands and verify they exit cleanly without hanging
  2. Test the new E2E test for the cancel command
  3. Verify that long-running processes using the workflow library can exit cleanly after calling World.close()

Why make this change?

Previously, processes using the workflow library could hang after completing their work because resources like HTTP agents, database connections, and queue listeners remained active. This change ensures that all resources are properly released when a process is done with the workflow world, allowing for clean exits without having to force termination with process.exit().

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: e058570

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

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

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

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

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Feb 16, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 16, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 534 0 38 572
✅ 💻 Local Development 556 0 68 624
✅ 📦 Local Production 556 0 68 624
✅ 🐘 Local Postgres 556 0 68 624
✅ 🪟 Windows 49 0 3 52
❌ 🌍 Community Worlds 110 46 9 165
✅ 📋 Other 135 0 21 156
Total 2496 46 275 2817

❌ Failed Tests

🌍 Community Worlds (46 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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 retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 48 0 4
✅ example 48 0 4
✅ express 48 0 4
✅ fastify 48 0 4
✅ hono 48 0 4
✅ nextjs-turbopack 51 0 1
✅ nextjs-webpack 51 0 1
✅ nitro 48 0 4
✅ nuxt 48 0 4
✅ sveltekit 48 0 4
✅ vite 48 0 4
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 45 0 7
✅ express-stable 45 0 7
✅ fastify-stable 45 0 7
✅ hono-stable 45 0 7
✅ nextjs-turbopack-canary 49 0 3
✅ nextjs-turbopack-stable 49 0 3
✅ nextjs-webpack-canary 49 0 3
✅ nextjs-webpack-stable 49 0 3
✅ nitro-stable 45 0 7
✅ nuxt-stable 45 0 7
✅ sveltekit-stable 45 0 7
✅ vite-stable 45 0 7
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 45 0 7
✅ express-stable 45 0 7
✅ fastify-stable 45 0 7
✅ hono-stable 45 0 7
✅ nextjs-turbopack-canary 49 0 3
✅ nextjs-turbopack-stable 49 0 3
✅ nextjs-webpack-canary 49 0 3
✅ nextjs-webpack-stable 49 0 3
✅ nitro-stable 45 0 7
✅ nuxt-stable 45 0 7
✅ sveltekit-stable 45 0 7
✅ vite-stable 45 0 7
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 45 0 7
✅ express-stable 45 0 7
✅ fastify-stable 45 0 7
✅ hono-stable 45 0 7
✅ nextjs-turbopack-canary 49 0 3
✅ nextjs-turbopack-stable 49 0 3
✅ nextjs-webpack-canary 49 0 3
✅ nextjs-webpack-stable 49 0 3
✅ nitro-stable 45 0 7
✅ nuxt-stable 45 0 7
✅ sveltekit-stable 45 0 7
✅ vite-stable 45 0 7
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 49 0 3
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 0
❌ mongodb 48 1 3
✅ redis-dev 3 0 0
✅ redis 49 0 3
✅ turso-dev 3 0 0
❌ turso 4 45 3
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 45 0 7
✅ e2e-local-postgres-nest-stable 45 0 7
✅ e2e-local-prod-nest-stable 45 0 7

📋 View full workflow run

Copy link
Copy Markdown
Member Author

TooTallNate commented Feb 16, 2026

@TooTallNate TooTallNate marked this pull request as ready for review February 16, 2026 17:14
@TooTallNate TooTallNate requested review from a team and Copilot and removed request for Copilot February 16, 2026 17:14
Copilot AI review requested due to automatic review settings February 16, 2026 17:16
@TooTallNate TooTallNate force-pushed the 02-16-add_world_close_interface branch from 3f8a43f to 5ac8bfa Compare February 16, 2026 17:16
@TooTallNate TooTallNate force-pushed the 02-16-add_world_close_interface branch from c2e6b13 to 8787447 Compare February 16, 2026 18:08
@TooTallNate TooTallNate changed the title Add World.close() for clean resource cleanup in CLI and short-lived processes Add World.close() for clean resource cleanup in CLI and short-lived processes Feb 16, 2026
// re-export runtime as stub for resolving to not
// require @workflow/core be a dependency as well as
// @workflow/cli
export * from '@workflow/core/runtime';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems unrelated?

Comment thread workbench/example/workflows/99_e2e.ts Outdated
Comment thread packages/world-postgres/src/index.ts Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 17, 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 🥇 Nitro 0.033s (-1.8%) 1.005s (~) 0.973s 10 1.00x
💻 Local Express 0.034s (+1.8%) 1.006s (~) 0.972s 10 1.03x
💻 Local Next.js (Turbopack) 0.039s (-1.5%) 1.005s (~) 0.966s 10 1.20x
🌐 Redis Next.js (Turbopack) 0.045s (~) 1.005s (~) 0.959s 10 1.40x
🐘 Postgres Nitro 0.091s (-73.0% 🟢) 1.010s (~) 0.919s 10 2.80x
🌐 MongoDB Next.js (Turbopack) 0.111s (-4.9%) 1.007s (~) 0.896s 10 3.39x
🐘 Postgres Express 0.132s (-5.2% 🟢) 1.010s (~) 0.878s 10 4.04x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 0.540s (-19.6% 🟢) 1.692s (-16.6% 🟢) 1.152s 10 1.00x
▲ Vercel Express 0.648s (+7.0% 🔺) 2.223s (+22.7% 🔺) 1.575s 10 1.20x
▲ Vercel Nitro 0.664s (+12.6% 🔺) 2.132s (+6.6% 🔺) 1.468s 10 1.23x

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

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 1.098s (~) 2.006s (~) 0.907s 10 1.00x
🌐 Redis Next.js (Turbopack) 1.108s (~) 2.006s (~) 0.898s 10 1.01x
💻 Local Nitro 1.110s (~) 2.006s (~) 0.896s 10 1.01x
💻 Local Express 1.111s (+0.7%) 2.006s (~) 0.895s 10 1.01x
🌐 MongoDB Next.js (Turbopack) 1.300s (~) 2.007s (~) 0.708s 10 1.18x
🐘 Postgres Express 2.410s (~) 3.014s (~) 0.604s 10 2.19x
🐘 Postgres Nitro 2.412s (+0.8%) 2.915s (-3.4%) 0.503s 10 2.20x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.217s (-7.4% 🟢) 2.932s (-10.8% 🟢) 0.716s 10 1.00x
▲ Vercel Nitro 2.277s (-1.3%) 3.247s (-1.8%) 0.970s 10 1.03x
▲ Vercel Express 2.405s (+6.1% 🔺) 3.501s (+8.5% 🔺) 1.095s 10 1.09x

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

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 10.706s (~) 11.023s (~) 0.317s 3 1.00x
💻 Local Next.js (Turbopack) 10.718s (~) 11.022s (~) 0.304s 3 1.00x
💻 Local Nitro 10.840s (~) 11.023s (~) 0.182s 3 1.01x
💻 Local Express 10.861s (~) 11.022s (~) 0.161s 3 1.01x
🌐 MongoDB Next.js (Turbopack) 12.257s (~) 13.020s (~) 0.763s 3 1.14x
🐘 Postgres Nitro 15.402s (-23.9% 🟢) 16.047s (-23.8% 🟢) 0.646s 2 1.44x
🐘 Postgres Express 20.375s (~) 21.060s (~) 0.686s 2 1.90x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 17.780s (+2.7%) 18.838s (+1.2%) 1.058s 2 1.00x
▲ Vercel Express 17.800s (~) 19.055s (+3.0%) 1.255s 2 1.00x
▲ Vercel Next.js (Turbopack) 20.064s (+8.1% 🔺) 20.626s (~) 0.562s 2 1.13x

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

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 26.941s (~) 27.050s (~) 0.109s 3 1.00x
💻 Local Next.js (Turbopack) 27.220s (~) 28.053s (~) 0.833s 3 1.01x
💻 Local Nitro 27.534s (~) 28.052s (~) 0.518s 3 1.02x
💻 Local Express 27.600s (~) 28.054s (~) 0.454s 3 1.02x
🌐 MongoDB Next.js (Turbopack) 30.453s (~) 31.039s (~) 0.586s 2 1.13x
🐘 Postgres Nitro 37.733s (-25.3% 🟢) 38.094s (-25.5% 🟢) 0.361s 2 1.40x
🐘 Postgres Express 50.387s (~) 51.132s (~) 0.745s 2 1.87x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 42.825s (+1.0%) 44.292s (+2.0%) 1.467s 2 1.00x
▲ Vercel Nitro 43.098s (-1.3%) 44.546s (-1.0%) 1.448s 2 1.01x
▲ Vercel Next.js (Turbopack) 43.797s (-2.8%) 44.863s (-3.1%) 1.066s 2 1.02x

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

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 54.345s (~) 55.097s (~) 0.752s 2 1.00x
💻 Local Next.js (Turbopack) 56.993s (+0.6%) 57.105s (~) 0.112s 2 1.05x
💻 Local Nitro 57.431s (~) 58.106s (~) 0.676s 2 1.06x
💻 Local Express 57.689s (+0.7%) 58.107s (~) 0.418s 2 1.06x
🌐 MongoDB Next.js (Turbopack) 60.734s (~) 61.059s (~) 0.325s 2 1.12x
🐘 Postgres Nitro 75.423s (-24.7% 🟢) 76.190s (-24.0% 🟢) 0.767s 2 1.39x
🐘 Postgres Express 100.276s (~) 101.245s (~) 0.969s 1 1.85x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 87.887s (~) 88.757s (-0.6%) 0.870s 2 1.00x
▲ Vercel Express 89.753s (+2.1%) 91.502s (+3.5%) 1.749s 1 1.02x
▲ Vercel Next.js (Turbopack) 90.417s (+0.8%) 91.030s (~) 0.613s 1 1.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 1.250s (+1.5%) 2.006s (~) 0.756s 15 1.00x
💻 Local Nitro 1.419s (+0.6%) 2.005s (~) 0.586s 15 1.14x
💻 Local Next.js (Turbopack) 1.420s (-0.6%) 2.005s (~) 0.585s 15 1.14x
💻 Local Express 1.444s (+1.7%) 2.005s (~) 0.562s 15 1.16x
🐘 Postgres Nitro 1.902s (-12.2% 🟢) 2.079s (-31.0% 🟢) 0.177s 15 1.52x
🌐 MongoDB Next.js (Turbopack) 2.167s (+2.0%) 3.007s (~) 0.839s 10 1.73x
🐘 Postgres Express 2.279s (-0.9%) 3.014s (~) 0.736s 10 1.82x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.579s (+12.7% 🔺) 3.570s (+10.4% 🔺) 0.992s 9 1.00x
▲ Vercel Next.js (Turbopack) 2.599s (+7.0% 🔺) 3.347s (-0.5%) 0.749s 9 1.01x
▲ Vercel Nitro 2.631s (+3.4%) 3.488s (-10.1% 🟢) 0.857s 9 1.02x

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

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 2.464s (-2.3%) 3.007s (~) 0.543s 10 1.00x
🌐 Redis Next.js (Turbopack) 2.491s (~) 3.008s (~) 0.516s 10 1.01x
💻 Local Express 2.652s (~) 3.008s (~) 0.356s 10 1.08x
💻 Local Nitro 2.671s (+1.6%) 3.007s (~) 0.336s 10 1.08x
🌐 MongoDB Next.js (Turbopack) 4.724s (-1.2%) 5.175s (~) 0.451s 6 1.92x
🐘 Postgres Nitro 7.979s (+1.4%) 8.281s (-3.0%) 0.302s 4 3.24x
🐘 Postgres Express 8.853s (+12.1% 🔺) 9.287s (+12.2% 🔺) 0.434s 4 3.59x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.667s (-15.5% 🟢) 3.547s (-10.4% 🟢) 0.880s 9 1.00x
▲ Vercel Next.js (Turbopack) 2.977s (-3.6%) 3.830s (-10.6% 🟢) 0.853s 8 1.12x
▲ Vercel Express 3.519s (+13.8% 🔺) 4.581s (+16.8% 🔺) 1.062s 7 1.32x

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

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 4.079s (~) 4.725s (~) 0.645s 7 1.00x
💻 Local Express 7.650s (~) 8.018s (~) 0.368s 4 1.88x
💻 Local Nitro 7.689s (-1.5%) 8.018s (~) 0.329s 4 1.88x
💻 Local Next.js (Turbopack) 7.855s (+7.0% 🔺) 8.520s (+6.3% 🔺) 0.665s 4 1.93x
🌐 MongoDB Next.js (Turbopack) 9.822s (~) 10.345s (~) 0.523s 3 2.41x
🐘 Postgres Express 46.021s (-7.2% 🟢) 46.145s (-8.0% 🟢) 0.124s 1 11.28x
🐘 Postgres Nitro 48.474s (-2.5%) 49.124s (-2.0%) 0.650s 1 11.88x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.106s (-1.0%) 3.966s (-13.2% 🟢) 0.860s 8 1.00x
▲ Vercel Nitro 3.472s (+9.5% 🔺) 4.633s (+6.6% 🔺) 1.161s 7 1.12x
▲ Vercel Next.js (Turbopack) 3.664s (+8.4% 🔺) 4.686s (+2.1%) 1.022s 7 1.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 1.235s (~) 2.006s (~) 0.771s 15 1.00x
💻 Local Next.js (Turbopack) 1.431s (~) 2.006s (~) 0.575s 15 1.16x
💻 Local Nitro 1.437s (+1.2%) 2.006s (~) 0.569s 15 1.16x
💻 Local Express 1.456s (+1.6%) 2.005s (~) 0.549s 15 1.18x
🐘 Postgres Nitro 2.071s (+11.9% 🔺) 2.833s (+40.8% 🔺) 0.762s 11 1.68x
🌐 MongoDB Next.js (Turbopack) 2.154s (-2.6%) 3.008s (~) 0.854s 10 1.74x
🐘 Postgres Express 2.240s (+12.0% 🔺) 2.835s (+9.1% 🔺) 0.596s 11 1.81x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.240s (-6.7% 🟢) 2.955s (-15.9% 🟢) 0.715s 11 1.00x
▲ Vercel Nitro 2.302s (+3.3%) 3.381s (-1.5%) 1.079s 9 1.03x
▲ Vercel Express 2.357s (+6.0% 🔺) 3.357s (+2.7%) 1.001s 9 1.05x

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

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 2.485s (~) 3.008s (~) 0.523s 10 1.00x
💻 Local Next.js (Turbopack) 2.680s (+3.0%) 3.009s (~) 0.328s 10 1.08x
💻 Local Nitro 2.736s (+0.6%) 3.008s (~) 0.272s 10 1.10x
💻 Local Express 2.889s (+4.3%) 3.111s (+3.4%) 0.222s 10 1.16x
🌐 MongoDB Next.js (Turbopack) 4.718s (~) 5.177s (~) 0.459s 6 1.90x
🐘 Postgres Nitro 10.126s (+14.9% 🔺) 10.704s (+15.3% 🔺) 0.578s 3 4.07x
🐘 Postgres Express 11.630s (-5.6% 🟢) 12.040s (-7.7% 🟢) 0.410s 3 4.68x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.448s (-2.7%) 3.535s (~) 1.087s 9 1.00x
▲ Vercel Express 2.518s (-10.9% 🟢) 3.535s (-6.0% 🟢) 1.017s 9 1.03x
▲ Vercel Next.js (Turbopack) 2.582s (+2.6%) 3.484s (+4.4%) 0.902s 9 1.05x

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

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 4.087s (+1.4%) 4.724s (+3.1%) 0.637s 7 1.00x
💻 Local Nitro 8.335s (~) 9.021s (~) 0.686s 4 2.04x
💻 Local Next.js (Turbopack) 8.341s (+13.7% 🔺) 9.016s (+16.1% 🔺) 0.676s 4 2.04x
💻 Local Express 8.732s (+3.7%) 9.022s (~) 0.290s 4 2.14x
🌐 MongoDB Next.js (Turbopack) 9.795s (~) 10.348s (~) 0.553s 3 2.40x
🐘 Postgres Nitro 49.258s (+5.0% 🔺) 50.118s (+6.3% 🔺) 0.860s 1 12.05x
🐘 Postgres Express 51.907s (-1.3%) 52.125s (-1.9%) 0.218s 1 12.70x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.748s (-2.4%) 3.545s (-1.9%) 0.796s 9 1.00x
▲ Vercel Next.js (Turbopack) 3.069s (-19.1% 🟢) 3.891s (-23.3% 🟢) 0.822s 8 1.12x
▲ Vercel Nitro 3.959s (+21.6% 🔺) 4.889s (+20.2% 🔺) 0.930s 7 1.44x

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

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 0.146s (+0.6%) 1.000s (~) 0.001s (-8.3% 🟢) 1.007s (~) 0.861s 10 1.00x
💻 Local Next.js (Turbopack) 0.146s (+3.6%) 1.001s (~) 0.012s (+13.3% 🔺) 1.017s (~) 0.871s 10 1.00x
💻 Local Nitro 0.174s (-1.5%) 1.002s (~) 0.011s (-7.3% 🟢) 1.017s (~) 0.843s 10 1.19x
💻 Local Express 0.186s (+9.6% 🔺) 1.002s (~) 0.012s (+7.3% 🔺) 1.017s (~) 0.831s 10 1.27x
🌐 MongoDB Next.js (Turbopack) 0.481s (-0.6%) 0.967s (+0.6%) 0.002s (+7.1% 🔺) 1.008s (~) 0.527s 10 3.30x
🐘 Postgres Nitro 1.357s (-39.9% 🟢) 1.730s (-37.8% 🟢) 0.001s (~) 2.014s (-33.2% 🟢) 0.657s 10 9.30x
🐘 Postgres Express 2.359s (-1.4%) 2.684s (+1.3%) 0.001s (+7.7% 🔺) 3.016s (~) 0.657s 10 16.17x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 1.908s (-16.3% 🟢) 2.642s (-2.9%) 0.342s (+86.5% 🔺) 3.591s (-6.1% 🟢) 1.683s 10 1.00x
▲ Vercel Next.js (Turbopack) 2.065s (+2.9%) 2.548s (-3.1%) 0.231s (+1.6%) 3.251s (-5.8% 🟢) 1.187s 10 1.08x
▲ Vercel Nitro 2.361s (+16.7% 🔺) 2.623s (+2.0%) 0.321s (+48.2% 🔺) 3.715s (+11.0% 🔺) 1.354s 10 1.24x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Next.js (Turbopack) 8/12
🐘 Postgres Nitro 10/12
▲ Vercel Express 5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 💻 Local 9/12
Next.js (Turbopack) 🌐 Redis 7/12
Nitro 💻 Local 8/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

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