Add stress test benchmarks for large concurrent step counts - #539

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts
Dec 5, 2025
Merged

Add stress test benchmarks for large concurrent step counts#539
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.

New workflows:

  • promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
  • promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern

New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

CopilotAI review requested due to automatic review settings December 5, 2025 00:25
@changeset-bot

changeset-botBot commented Dec 5, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9487c93

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

This PR includes changesets to release 14 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@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 Dec 5, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 5, 2025

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🥇 Nitro0.030s (-31.6% 🟢)1.007s (~)0.976s101.00x
🌐 RedisNext.js (Turbopack)0.037s (-9.0% 🟢)1.019s (~)0.983s101.21x
🌐 StarterNext.js (Turbopack)0.040s (+16.1% 🔺)1.015s (~)0.975s101.31x
💻 LocalNext.js (Turbopack)0.041s (+1.5%)1.016s (~)0.975s101.36x
💻 LocalExpress0.044s (-1.6%)1.008s (~)0.964s101.45x
🐘 PostgresNext.js (Turbopack)0.123s (-46.7% 🟢)1.018s (~)0.895s104.06x
🌐 MongoDBNext.js (Turbopack)0.129s (+99.4% 🔺)1.016s (~)0.888s104.24x
🐘 PostgresNitro0.248s (+27.6% 🔺)1.023s (-0.8%)0.775s108.20x
🐘 PostgresExpress0.378s (+32.5% 🔺)1.012s (~)0.634s1012.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.602s (+20.6% 🔺)1.592s (+11.9% 🔺)0.991s101.00x
▲ VercelExpress0.642s (+38.4% 🔺)1.517s (+8.8% 🔺)0.875s101.07x
▲ VercelNext.js (Turbopack)0.745s (+12.9% 🔺)1.695s (+0.6%)0.950s101.24x

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.076s (-32.0% 🟢)1.006s (~)0.930s101.00x
🌐 RedisNext.js (Turbopack)0.078s (-20.9% 🟢)1.013s (~)0.935s101.03x
🌐 StarterNext.js (Turbopack)0.081s (+2.1%)1.011s (~)0.930s101.07x
💻 LocalNext.js (Turbopack)0.086s (-6.3% 🟢)1.010s (~)0.924s101.14x
💻 LocalExpress0.113s (~)1.006s (~)0.894s101.49x
🌐 MongoDBNext.js (Turbopack)0.312s (-1.1%)1.012s (~)0.699s104.13x
🐘 PostgresNext.js (Turbopack)0.942s (+8.7% 🔺)1.115s (+10.0% 🔺)0.173s1012.44x
🐘 PostgresNitro1.131s (-22.9% 🟢)2.012s (~)0.881s1014.94x
🐘 PostgresExpress1.251s (+9.0% 🔺)2.009s (~)0.759s1016.52x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.522s (+8.6% 🔺)2.603s (+8.1% 🔺)1.081s101.00x
▲ VercelExpress1.535s (+8.2% 🔺)2.462s (+3.6%)0.927s101.01x
▲ VercelNitro1.599s (+20.5% 🔺)2.599s (+7.8% 🔺)1.000s101.05x

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.506s (-34.7% 🟢)1.005s (~)0.499s51.00x
🌐 RedisNext.js (Turbopack)0.514s (-16.2% 🟢)1.012s (~)0.499s51.02x
🌐 StarterNext.js (Turbopack)0.580s (~)1.010s (~)0.429s51.15x
💻 LocalNext.js (Turbopack)0.613s (+0.6%)1.009s (~)0.396s51.21x
💻 LocalExpress0.771s (-0.8%)1.006s (~)0.235s51.52x
🌐 MongoDBNext.js (Turbopack)2.129s (-1.4%)3.013s (~)0.884s54.21x
🐘 PostgresNext.js (Turbopack)5.013s (-4.5%)5.216s (-13.4% 🟢)0.203s59.91x
🐘 PostgresNitro8.253s (+54.4% 🔺)8.617s (+43.2% 🔺)0.364s516.32x
🐘 PostgresExpress9.256s (-11.2% 🟢)10.018s (-9.1% 🟢)0.762s518.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro10.274s (-38.3% 🟢)10.904s (-36.0% 🟢)0.630s51.00x
▲ VercelNext.js (Turbopack)10.365s (+6.9% 🔺)11.236s (+8.0% 🔺)0.871s51.01x
▲ VercelExpress10.740s (+6.7% 🔺)11.328s (+7.3% 🔺)0.588s51.05x

workflow with 10 parallel steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.335s (-15.5% 🟢)1.005s (~)0.671s51.00x
🌐 StarterNext.js (Turbopack)0.365s (+2.2%)1.008s (~)0.644s51.09x
💻 LocalNext.js (Turbopack)0.372s (-9.6% 🟢)1.009s (~)0.637s51.11x
🌐 RedisNext.js (Turbopack)0.379s (+6.5% 🔺)1.011s (~)0.632s51.13x
💻 LocalExpress0.419s (-1.3%)1.006s (~)0.588s51.25x
🐘 PostgresNext.js (Turbopack)0.750s (-9.2% 🟢)1.013s (-16.5% 🟢)0.263s52.24x
🐘 PostgresExpress1.106s (-32.4% 🟢)2.013s (~)0.907s53.31x
🐘 PostgresNitro1.164s (+23.4% 🔺)1.618s (+14.8% 🔺)0.454s53.48x
🌐 MongoDBNext.js (Turbopack)1.592s (+1.1%)2.009s (~)0.417s54.76x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.734s (+9.7% 🔺)3.469s (+1.7%)0.734s51.00x
▲ VercelNitro2.923s (+7.7% 🔺)3.679s (+4.0%)0.756s51.07x
▲ VercelNext.js (Turbopack)2.968s (+17.0% 🔺)3.737s (+9.1% 🔺)0.769s51.09x

stress test: Promise.all with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.783s2.036s0.253s151.00x
🌐 RedisNext.js (Turbopack)3.758s4.073s0.315s82.11x
🐘 PostgresNext.js (Turbopack)8.075s8.403s0.328s44.53x
💻 LocalNitro8.217s8.505s0.288s44.61x
🐘 PostgresExpress8.232s8.666s0.434s44.62x
🐘 PostgresNitro8.365s8.860s0.495s44.69x
💻 LocalNext.js (Turbopack)10.060s10.339s0.279s35.64x
💻 LocalExpress11.128s11.607s0.480s36.24x
🌐 MongoDBNext.js (Turbopack)19.788s20.566s0.778s211.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.898s18.865s0.967s21.00x
▲ VercelNitro21.856s22.435s0.579s21.22x
▲ VercelNext.js (Turbopack)23.483s24.076s0.594s21.31x

stress test: Promise.race with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)2.029s2.094s0.065s151.00x
🌐 RedisNext.js (Turbopack)3.906s4.362s0.456s71.93x
🐘 PostgresNext.js (Turbopack)8.845s9.083s0.237s44.36x
🐘 PostgresNitro9.212s9.497s0.285s44.54x
🐘 PostgresExpress9.417s9.854s0.437s44.64x
💻 LocalExpress9.762s10.286s0.524s44.81x
💻 LocalNitro10.275s10.653s0.378s35.06x
💻 LocalNext.js (Turbopack)11.230s11.739s0.509s35.54x
🌐 MongoDBNext.js (Turbopack)20.093s20.520s0.427s29.90x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.370s16.098s0.728s21.00x
▲ VercelNitro15.832s16.430s0.598s21.03x
▲ VercelExpress16.401s16.779s0.377s21.07x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.114s (-37.0% 🟢)0.998s (+0.7%)1.008s (~)0.894s101.00x
🌐 RedisNext.js (Turbopack)0.115s (-19.8% 🟢)1.003s (~)1.011s (~)0.896s101.02x
🌐 StarterNext.js (Turbopack)0.127s (-3.5%)1.004s (~)1.008s (~)0.881s101.12x
💻 LocalNext.js (Turbopack)0.138s (-3.8%)1.002s (~)1.013s (~)0.875s101.22x
💻 LocalExpress0.179s (-1.3%)0.992s (~)1.009s (~)0.830s101.58x
🌐 MongoDBNext.js (Turbopack)0.466s (-2.5%)0.978s (+0.8%)1.011s (~)0.545s104.10x
🐘 PostgresNext.js (Turbopack)0.662s (-20.4% 🟢)0.956s (-30.1% 🟢)1.012s (-28.4% 🟢)0.350s105.84x
🐘 PostgresNitro1.206s (+3.9%)1.833s (-2.4%)2.011s (~)0.805s1010.63x
🐘 PostgresExpress1.453s (-31.0% 🟢)1.587s (-34.8% 🟢)2.011s (-25.9% 🟢)0.558s1012.80x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.424s (+7.5% 🔺)2.842s (+13.3% 🔺)3.254s (+13.9% 🔺)0.830s101.00x
▲ VercelNext.js (Turbopack)2.555s (+9.7% 🔺)2.982s (+25.6% 🔺)3.420s (+22.7% 🔺)0.865s101.05x
▲ VercelNitro2.558s (+11.2% 🔺)3.024s (+13.1% 🔺)3.467s (+11.4% 🔺)0.909s101.06x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro6/7
🐘 PostgresNext.js (Turbopack)7/7
▲ VercelExpress3/7

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/7
Next.js (Turbopack)🌐 Redis4/7
Nitro💻 Local6/7
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)
  • 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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

@github-actions

github-actionsBot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
⚠️ ▲ Vercel Production250010260
✅ 🪟 Windows260026
❌ 🌍 Community Worlds82340116
❌ 📋 Other241126
Total3823511428

❌ Failed Tests

mongodb (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 202 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:255:24
at processTicksAndRejections (node:internal/process/tas
redis (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 200 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:285:25
at processTicksAndRejections (node:internal/process/tas
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(3) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'failed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:647:30
at processTicksAndRejections (node:internal/
starter (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:725:31
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:748:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:784:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:835:36
at processTicksAndRejections (node:intern
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pack
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F98_duplicate_case.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/wo
turso (🌍 Community Worlds): e2e should work with react rendering in step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F8_react_render.tsx&workflowFn=reactWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e promiseAllWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAllWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e promiseRaceWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow
turso (🌍 Community Worlds): e2e promiseAnyWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAnyWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e readableStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=readableStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packag
turso (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=webhookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pac
turso (🌍 Community Worlds): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=sleepingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e nullByteWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=nullByteWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e workflowAndStepMetadataWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=workflowAndStepMetadataWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e outputStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflo
turso (🌍 Community Worlds): e2e outputStreamInsideStepWorkflow - getWritable() called inside step functions

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamInsideStepWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e fetchWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=fetchWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packa
turso (🌍 Community Worlds): e2e promiseRaceStressTestWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceStressTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
turso (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryAttemptCounterWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e retryableAndFatalErrorWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryableAndFatalErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=crossFileErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookCleanupTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionPassingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionWithClosureWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e closureVariableWorkflow - nested step functions with closure variables

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=closureVariableWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=spawnWorkflowFromStepWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
e2e-vercel-prod-fastify (📋 Other): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: STACK_TRACE_ERROR
at task (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:638:27)
at Object.<anonymou

Details by Category

⚠️ ▲ Vercel Production
AppPassedFailedSkipped
⚠️ astro2501
⚠️ example2501
⚠️ express2501
⚠️ hono2501
⚠️ nextjs-turbopack2501
⚠️ nextjs-webpack2501
⚠️ nitro2501
⚠️ nuxt2501
⚠️ sveltekit2501
⚠️ vite2501
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack2600
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb2510
✅ redis-dev300
❌ redis2510
✅ starter-dev300
❌ starter1880
✅ turso-dev300
❌ turso2240
❌ 📋 Other
AppPassedFailedSkipped
❌ e2e-vercel-prod-fastify2411

⚠️Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygpGraphite App

pranaygp commented Dec 5, 2025

Copy link
Copy Markdown
ContributorAuthor

CopilotAI 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.

Pull request overview

This PR adds stress test benchmarks to reproduce and measure performance issues with Promise.race and Promise.all when handling hundreds to thousands of concurrent steps. The benchmarks test workflow execution at 100, 500, and 1000 concurrent step scales.

  • Adds two new stress test workflow functions to isolate concurrent step tracking overhead
  • Introduces six new benchmark tests (3 for Promise.all, 3 for Promise.race) at different scales
  • Uses longer timeout durations and fewer iterations for larger tests to accommodate potential performance degradation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
workbench/example/workflows/97_bench.tsAdds stressTestStep, promiseAllStressTestWorkflow, and promiseRaceStressTestLargeWorkflow to test concurrent step handling at scale
packages/core/e2e/bench.bench.tsAdds 6 new benchmark tests for Promise.all and Promise.race patterns with 100/500/1000 concurrent steps, using appropriate timeout and iteration configurations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +121 to +123
const result = await Promise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);

CopilotAIDec 5, 2025

Copy link

Choose a reason for hiding this comment

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

The Promise.race pattern has a logical bug. The Map is keyed by index i, but runningTasks.delete(result) attempts to delete using the result value (which equals i since stressTestStep(i) returns i). While this happens to work when result equals the key, it creates a tight coupling and will fail if the step returns any value different from its input.

Additionally, this doesn't correctly track which promise completed. Since multiple tasks can have the same result value, deleting by result could remove the wrong task or fail to remove any task if the result doesn't match a key.

Consider using Promise.race with an array of objects that include both the promise and its key:

construnningTasks=newMap<number,Promise<number>>();for(leti=0;i<count;i++){runningTasks.set(i,stressTestStep(i));}constdone: number[]=[];while(runningTasks.size>0){constentries=Array.from(runningTasks.entries());constracePromises=entries.map(([key,promise])=>promise.then(result=>({ key, result })));const{ key, result }=awaitPromise.race(racePromises);done.push(result);runningTasks.delete(key);}
Suggested change
constresult=awaitPromise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);
constentries=Array.from(runningTasks.entries());
constracePromises=entries.map(([key,promise])=>
promise.then(result=>({ key, result }))
);
const{ key, result }=awaitPromise.race(racePromises);
done.push(result);
runningTasks.delete(key);

Copilot uses AI. Check for mistakes.
pranaygpand others added 5 commits December 4, 2025 22:13
Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.
New workflows:
- promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
- promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern
New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add in-memory cache for file existence checks to avoid expensive fs.access() calls
- Increase default concurrency limit from 20 to 100
- Improve HTTP connection pooling (100 connections, 30s keep-alive)
These optimizations significantly improve performance when running workflows
with many concurrent steps (100+).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Skip warmup iterations and run only 1 sample for stress tests
to reduce CI time while still catching the reported issue.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Temporarily skip the high-concurrency benchmarks (500/1000 steps) to
avoid CI issues while we implement performance optimizations.
See beads issue wrk-fyx for the optimization plan.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
{ time: 60000, iterations: 1, warmupIterations: 0, teardown }
);

// TODO: Re-enable after performance optimizations (see beads issue wrk-fyx)

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.

Should we also be stress testing for Promise.allSettled?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Can add more in a future PR but should be no different than Promise.all where everything succeeds

Will need to add a new step that throws errors too, to stress test retrying steps that fail

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I'm gonna make sure these tests are performant with the incoming PRs, and make sure they don't break (hence why I disabled 500 and 1k) and then will add more teats

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.

4 participants

@pranaygp@VaguelySerious@karthikscale3
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n 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;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Add stress test benchmarks for large concurrent step counts - #539

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts
Dec 5, 2025
Merged

Add stress test benchmarks for large concurrent step counts#539
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.

New workflows:

  • promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
  • promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern

New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

CopilotAI review requested due to automatic review settings December 5, 2025 00:25
@changeset-bot

changeset-botBot commented Dec 5, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9487c93

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

This PR includes changesets to release 14 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@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 Dec 5, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 5, 2025

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🥇 Nitro0.030s (-31.6% 🟢)1.007s (~)0.976s101.00x
🌐 RedisNext.js (Turbopack)0.037s (-9.0% 🟢)1.019s (~)0.983s101.21x
🌐 StarterNext.js (Turbopack)0.040s (+16.1% 🔺)1.015s (~)0.975s101.31x
💻 LocalNext.js (Turbopack)0.041s (+1.5%)1.016s (~)0.975s101.36x
💻 LocalExpress0.044s (-1.6%)1.008s (~)0.964s101.45x
🐘 PostgresNext.js (Turbopack)0.123s (-46.7% 🟢)1.018s (~)0.895s104.06x
🌐 MongoDBNext.js (Turbopack)0.129s (+99.4% 🔺)1.016s (~)0.888s104.24x
🐘 PostgresNitro0.248s (+27.6% 🔺)1.023s (-0.8%)0.775s108.20x
🐘 PostgresExpress0.378s (+32.5% 🔺)1.012s (~)0.634s1012.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.602s (+20.6% 🔺)1.592s (+11.9% 🔺)0.991s101.00x
▲ VercelExpress0.642s (+38.4% 🔺)1.517s (+8.8% 🔺)0.875s101.07x
▲ VercelNext.js (Turbopack)0.745s (+12.9% 🔺)1.695s (+0.6%)0.950s101.24x

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.076s (-32.0% 🟢)1.006s (~)0.930s101.00x
🌐 RedisNext.js (Turbopack)0.078s (-20.9% 🟢)1.013s (~)0.935s101.03x
🌐 StarterNext.js (Turbopack)0.081s (+2.1%)1.011s (~)0.930s101.07x
💻 LocalNext.js (Turbopack)0.086s (-6.3% 🟢)1.010s (~)0.924s101.14x
💻 LocalExpress0.113s (~)1.006s (~)0.894s101.49x
🌐 MongoDBNext.js (Turbopack)0.312s (-1.1%)1.012s (~)0.699s104.13x
🐘 PostgresNext.js (Turbopack)0.942s (+8.7% 🔺)1.115s (+10.0% 🔺)0.173s1012.44x
🐘 PostgresNitro1.131s (-22.9% 🟢)2.012s (~)0.881s1014.94x
🐘 PostgresExpress1.251s (+9.0% 🔺)2.009s (~)0.759s1016.52x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.522s (+8.6% 🔺)2.603s (+8.1% 🔺)1.081s101.00x
▲ VercelExpress1.535s (+8.2% 🔺)2.462s (+3.6%)0.927s101.01x
▲ VercelNitro1.599s (+20.5% 🔺)2.599s (+7.8% 🔺)1.000s101.05x

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.506s (-34.7% 🟢)1.005s (~)0.499s51.00x
🌐 RedisNext.js (Turbopack)0.514s (-16.2% 🟢)1.012s (~)0.499s51.02x
🌐 StarterNext.js (Turbopack)0.580s (~)1.010s (~)0.429s51.15x
💻 LocalNext.js (Turbopack)0.613s (+0.6%)1.009s (~)0.396s51.21x
💻 LocalExpress0.771s (-0.8%)1.006s (~)0.235s51.52x
🌐 MongoDBNext.js (Turbopack)2.129s (-1.4%)3.013s (~)0.884s54.21x
🐘 PostgresNext.js (Turbopack)5.013s (-4.5%)5.216s (-13.4% 🟢)0.203s59.91x
🐘 PostgresNitro8.253s (+54.4% 🔺)8.617s (+43.2% 🔺)0.364s516.32x
🐘 PostgresExpress9.256s (-11.2% 🟢)10.018s (-9.1% 🟢)0.762s518.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro10.274s (-38.3% 🟢)10.904s (-36.0% 🟢)0.630s51.00x
▲ VercelNext.js (Turbopack)10.365s (+6.9% 🔺)11.236s (+8.0% 🔺)0.871s51.01x
▲ VercelExpress10.740s (+6.7% 🔺)11.328s (+7.3% 🔺)0.588s51.05x

workflow with 10 parallel steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.335s (-15.5% 🟢)1.005s (~)0.671s51.00x
🌐 StarterNext.js (Turbopack)0.365s (+2.2%)1.008s (~)0.644s51.09x
💻 LocalNext.js (Turbopack)0.372s (-9.6% 🟢)1.009s (~)0.637s51.11x
🌐 RedisNext.js (Turbopack)0.379s (+6.5% 🔺)1.011s (~)0.632s51.13x
💻 LocalExpress0.419s (-1.3%)1.006s (~)0.588s51.25x
🐘 PostgresNext.js (Turbopack)0.750s (-9.2% 🟢)1.013s (-16.5% 🟢)0.263s52.24x
🐘 PostgresExpress1.106s (-32.4% 🟢)2.013s (~)0.907s53.31x
🐘 PostgresNitro1.164s (+23.4% 🔺)1.618s (+14.8% 🔺)0.454s53.48x
🌐 MongoDBNext.js (Turbopack)1.592s (+1.1%)2.009s (~)0.417s54.76x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.734s (+9.7% 🔺)3.469s (+1.7%)0.734s51.00x
▲ VercelNitro2.923s (+7.7% 🔺)3.679s (+4.0%)0.756s51.07x
▲ VercelNext.js (Turbopack)2.968s (+17.0% 🔺)3.737s (+9.1% 🔺)0.769s51.09x

stress test: Promise.all with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.783s2.036s0.253s151.00x
🌐 RedisNext.js (Turbopack)3.758s4.073s0.315s82.11x
🐘 PostgresNext.js (Turbopack)8.075s8.403s0.328s44.53x
💻 LocalNitro8.217s8.505s0.288s44.61x
🐘 PostgresExpress8.232s8.666s0.434s44.62x
🐘 PostgresNitro8.365s8.860s0.495s44.69x
💻 LocalNext.js (Turbopack)10.060s10.339s0.279s35.64x
💻 LocalExpress11.128s11.607s0.480s36.24x
🌐 MongoDBNext.js (Turbopack)19.788s20.566s0.778s211.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.898s18.865s0.967s21.00x
▲ VercelNitro21.856s22.435s0.579s21.22x
▲ VercelNext.js (Turbopack)23.483s24.076s0.594s21.31x

stress test: Promise.race with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)2.029s2.094s0.065s151.00x
🌐 RedisNext.js (Turbopack)3.906s4.362s0.456s71.93x
🐘 PostgresNext.js (Turbopack)8.845s9.083s0.237s44.36x
🐘 PostgresNitro9.212s9.497s0.285s44.54x
🐘 PostgresExpress9.417s9.854s0.437s44.64x
💻 LocalExpress9.762s10.286s0.524s44.81x
💻 LocalNitro10.275s10.653s0.378s35.06x
💻 LocalNext.js (Turbopack)11.230s11.739s0.509s35.54x
🌐 MongoDBNext.js (Turbopack)20.093s20.520s0.427s29.90x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.370s16.098s0.728s21.00x
▲ VercelNitro15.832s16.430s0.598s21.03x
▲ VercelExpress16.401s16.779s0.377s21.07x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.114s (-37.0% 🟢)0.998s (+0.7%)1.008s (~)0.894s101.00x
🌐 RedisNext.js (Turbopack)0.115s (-19.8% 🟢)1.003s (~)1.011s (~)0.896s101.02x
🌐 StarterNext.js (Turbopack)0.127s (-3.5%)1.004s (~)1.008s (~)0.881s101.12x
💻 LocalNext.js (Turbopack)0.138s (-3.8%)1.002s (~)1.013s (~)0.875s101.22x
💻 LocalExpress0.179s (-1.3%)0.992s (~)1.009s (~)0.830s101.58x
🌐 MongoDBNext.js (Turbopack)0.466s (-2.5%)0.978s (+0.8%)1.011s (~)0.545s104.10x
🐘 PostgresNext.js (Turbopack)0.662s (-20.4% 🟢)0.956s (-30.1% 🟢)1.012s (-28.4% 🟢)0.350s105.84x
🐘 PostgresNitro1.206s (+3.9%)1.833s (-2.4%)2.011s (~)0.805s1010.63x
🐘 PostgresExpress1.453s (-31.0% 🟢)1.587s (-34.8% 🟢)2.011s (-25.9% 🟢)0.558s1012.80x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.424s (+7.5% 🔺)2.842s (+13.3% 🔺)3.254s (+13.9% 🔺)0.830s101.00x
▲ VercelNext.js (Turbopack)2.555s (+9.7% 🔺)2.982s (+25.6% 🔺)3.420s (+22.7% 🔺)0.865s101.05x
▲ VercelNitro2.558s (+11.2% 🔺)3.024s (+13.1% 🔺)3.467s (+11.4% 🔺)0.909s101.06x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro6/7
🐘 PostgresNext.js (Turbopack)7/7
▲ VercelExpress3/7

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/7
Next.js (Turbopack)🌐 Redis4/7
Nitro💻 Local6/7
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)
  • 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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

@github-actions

github-actionsBot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
⚠️ ▲ Vercel Production250010260
✅ 🪟 Windows260026
❌ 🌍 Community Worlds82340116
❌ 📋 Other241126
Total3823511428

❌ Failed Tests

mongodb (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 202 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:255:24
at processTicksAndRejections (node:internal/process/tas
redis (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 200 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:285:25
at processTicksAndRejections (node:internal/process/tas
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(3) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'failed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:647:30
at processTicksAndRejections (node:internal/
starter (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:725:31
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:748:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:784:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:835:36
at processTicksAndRejections (node:intern
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pack
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F98_duplicate_case.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/wo
turso (🌍 Community Worlds): e2e should work with react rendering in step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F8_react_render.tsx&workflowFn=reactWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e promiseAllWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAllWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e promiseRaceWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow
turso (🌍 Community Worlds): e2e promiseAnyWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAnyWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e readableStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=readableStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packag
turso (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=webhookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pac
turso (🌍 Community Worlds): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=sleepingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e nullByteWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=nullByteWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e workflowAndStepMetadataWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=workflowAndStepMetadataWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e outputStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflo
turso (🌍 Community Worlds): e2e outputStreamInsideStepWorkflow - getWritable() called inside step functions

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamInsideStepWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e fetchWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=fetchWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packa
turso (🌍 Community Worlds): e2e promiseRaceStressTestWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceStressTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
turso (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryAttemptCounterWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e retryableAndFatalErrorWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryableAndFatalErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=crossFileErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookCleanupTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionPassingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionWithClosureWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e closureVariableWorkflow - nested step functions with closure variables

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=closureVariableWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=spawnWorkflowFromStepWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
e2e-vercel-prod-fastify (📋 Other): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: STACK_TRACE_ERROR
at task (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:638:27)
at Object.<anonymou

Details by Category

⚠️ ▲ Vercel Production
AppPassedFailedSkipped
⚠️ astro2501
⚠️ example2501
⚠️ express2501
⚠️ hono2501
⚠️ nextjs-turbopack2501
⚠️ nextjs-webpack2501
⚠️ nitro2501
⚠️ nuxt2501
⚠️ sveltekit2501
⚠️ vite2501
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack2600
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb2510
✅ redis-dev300
❌ redis2510
✅ starter-dev300
❌ starter1880
✅ turso-dev300
❌ turso2240
❌ 📋 Other
AppPassedFailedSkipped
❌ e2e-vercel-prod-fastify2411

⚠️Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygpGraphite App

pranaygp commented Dec 5, 2025

Copy link
Copy Markdown
ContributorAuthor

CopilotAI 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.

Pull request overview

This PR adds stress test benchmarks to reproduce and measure performance issues with Promise.race and Promise.all when handling hundreds to thousands of concurrent steps. The benchmarks test workflow execution at 100, 500, and 1000 concurrent step scales.

  • Adds two new stress test workflow functions to isolate concurrent step tracking overhead
  • Introduces six new benchmark tests (3 for Promise.all, 3 for Promise.race) at different scales
  • Uses longer timeout durations and fewer iterations for larger tests to accommodate potential performance degradation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
workbench/example/workflows/97_bench.tsAdds stressTestStep, promiseAllStressTestWorkflow, and promiseRaceStressTestLargeWorkflow to test concurrent step handling at scale
packages/core/e2e/bench.bench.tsAdds 6 new benchmark tests for Promise.all and Promise.race patterns with 100/500/1000 concurrent steps, using appropriate timeout and iteration configurations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +121 to +123
const result = await Promise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);

CopilotAIDec 5, 2025

Copy link

Choose a reason for hiding this comment

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

The Promise.race pattern has a logical bug. The Map is keyed by index i, but runningTasks.delete(result) attempts to delete using the result value (which equals i since stressTestStep(i) returns i). While this happens to work when result equals the key, it creates a tight coupling and will fail if the step returns any value different from its input.

Additionally, this doesn't correctly track which promise completed. Since multiple tasks can have the same result value, deleting by result could remove the wrong task or fail to remove any task if the result doesn't match a key.

Consider using Promise.race with an array of objects that include both the promise and its key:

construnningTasks=newMap<number,Promise<number>>();for(leti=0;i<count;i++){runningTasks.set(i,stressTestStep(i));}constdone: number[]=[];while(runningTasks.size>0){constentries=Array.from(runningTasks.entries());constracePromises=entries.map(([key,promise])=>promise.then(result=>({ key, result })));const{ key, result }=awaitPromise.race(racePromises);done.push(result);runningTasks.delete(key);}
Suggested change
constresult=awaitPromise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);
constentries=Array.from(runningTasks.entries());
constracePromises=entries.map(([key,promise])=>
promise.then(result=>({ key, result }))
);
const{ key, result }=awaitPromise.race(racePromises);
done.push(result);
runningTasks.delete(key);

Copilot uses AI. Check for mistakes.
pranaygpand others added 5 commits December 4, 2025 22:13
Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.
New workflows:
- promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
- promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern
New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add in-memory cache for file existence checks to avoid expensive fs.access() calls
- Increase default concurrency limit from 20 to 100
- Improve HTTP connection pooling (100 connections, 30s keep-alive)
These optimizations significantly improve performance when running workflows
with many concurrent steps (100+).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Skip warmup iterations and run only 1 sample for stress tests
to reduce CI time while still catching the reported issue.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Temporarily skip the high-concurrency benchmarks (500/1000 steps) to
avoid CI issues while we implement performance optimizations.
See beads issue wrk-fyx for the optimization plan.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
{ time: 60000, iterations: 1, warmupIterations: 0, teardown }
);

// TODO: Re-enable after performance optimizations (see beads issue wrk-fyx)

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.

Should we also be stress testing for Promise.allSettled?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Can add more in a future PR but should be no different than Promise.all where everything succeeds

Will need to add a new step that throws errors too, to stress test retrying steps that fail

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I'm gonna make sure these tests are performant with the incoming PRs, and make sure they don't break (hence why I disabled 500 and 1k) and then will add more teats

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.

4 participants

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

Add stress test benchmarks for large concurrent step counts - #539

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts
Dec 5, 2025
Merged

Add stress test benchmarks for large concurrent step counts#539
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.

New workflows:

  • promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
  • promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern

New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

CopilotAI review requested due to automatic review settings December 5, 2025 00:25
@changeset-bot

changeset-botBot commented Dec 5, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9487c93

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

This PR includes changesets to release 14 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@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 Dec 5, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 5, 2025

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🥇 Nitro0.030s (-31.6% 🟢)1.007s (~)0.976s101.00x
🌐 RedisNext.js (Turbopack)0.037s (-9.0% 🟢)1.019s (~)0.983s101.21x
🌐 StarterNext.js (Turbopack)0.040s (+16.1% 🔺)1.015s (~)0.975s101.31x
💻 LocalNext.js (Turbopack)0.041s (+1.5%)1.016s (~)0.975s101.36x
💻 LocalExpress0.044s (-1.6%)1.008s (~)0.964s101.45x
🐘 PostgresNext.js (Turbopack)0.123s (-46.7% 🟢)1.018s (~)0.895s104.06x
🌐 MongoDBNext.js (Turbopack)0.129s (+99.4% 🔺)1.016s (~)0.888s104.24x
🐘 PostgresNitro0.248s (+27.6% 🔺)1.023s (-0.8%)0.775s108.20x
🐘 PostgresExpress0.378s (+32.5% 🔺)1.012s (~)0.634s1012.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.602s (+20.6% 🔺)1.592s (+11.9% 🔺)0.991s101.00x
▲ VercelExpress0.642s (+38.4% 🔺)1.517s (+8.8% 🔺)0.875s101.07x
▲ VercelNext.js (Turbopack)0.745s (+12.9% 🔺)1.695s (+0.6%)0.950s101.24x

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.076s (-32.0% 🟢)1.006s (~)0.930s101.00x
🌐 RedisNext.js (Turbopack)0.078s (-20.9% 🟢)1.013s (~)0.935s101.03x
🌐 StarterNext.js (Turbopack)0.081s (+2.1%)1.011s (~)0.930s101.07x
💻 LocalNext.js (Turbopack)0.086s (-6.3% 🟢)1.010s (~)0.924s101.14x
💻 LocalExpress0.113s (~)1.006s (~)0.894s101.49x
🌐 MongoDBNext.js (Turbopack)0.312s (-1.1%)1.012s (~)0.699s104.13x
🐘 PostgresNext.js (Turbopack)0.942s (+8.7% 🔺)1.115s (+10.0% 🔺)0.173s1012.44x
🐘 PostgresNitro1.131s (-22.9% 🟢)2.012s (~)0.881s1014.94x
🐘 PostgresExpress1.251s (+9.0% 🔺)2.009s (~)0.759s1016.52x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.522s (+8.6% 🔺)2.603s (+8.1% 🔺)1.081s101.00x
▲ VercelExpress1.535s (+8.2% 🔺)2.462s (+3.6%)0.927s101.01x
▲ VercelNitro1.599s (+20.5% 🔺)2.599s (+7.8% 🔺)1.000s101.05x

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.506s (-34.7% 🟢)1.005s (~)0.499s51.00x
🌐 RedisNext.js (Turbopack)0.514s (-16.2% 🟢)1.012s (~)0.499s51.02x
🌐 StarterNext.js (Turbopack)0.580s (~)1.010s (~)0.429s51.15x
💻 LocalNext.js (Turbopack)0.613s (+0.6%)1.009s (~)0.396s51.21x
💻 LocalExpress0.771s (-0.8%)1.006s (~)0.235s51.52x
🌐 MongoDBNext.js (Turbopack)2.129s (-1.4%)3.013s (~)0.884s54.21x
🐘 PostgresNext.js (Turbopack)5.013s (-4.5%)5.216s (-13.4% 🟢)0.203s59.91x
🐘 PostgresNitro8.253s (+54.4% 🔺)8.617s (+43.2% 🔺)0.364s516.32x
🐘 PostgresExpress9.256s (-11.2% 🟢)10.018s (-9.1% 🟢)0.762s518.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro10.274s (-38.3% 🟢)10.904s (-36.0% 🟢)0.630s51.00x
▲ VercelNext.js (Turbopack)10.365s (+6.9% 🔺)11.236s (+8.0% 🔺)0.871s51.01x
▲ VercelExpress10.740s (+6.7% 🔺)11.328s (+7.3% 🔺)0.588s51.05x

workflow with 10 parallel steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.335s (-15.5% 🟢)1.005s (~)0.671s51.00x
🌐 StarterNext.js (Turbopack)0.365s (+2.2%)1.008s (~)0.644s51.09x
💻 LocalNext.js (Turbopack)0.372s (-9.6% 🟢)1.009s (~)0.637s51.11x
🌐 RedisNext.js (Turbopack)0.379s (+6.5% 🔺)1.011s (~)0.632s51.13x
💻 LocalExpress0.419s (-1.3%)1.006s (~)0.588s51.25x
🐘 PostgresNext.js (Turbopack)0.750s (-9.2% 🟢)1.013s (-16.5% 🟢)0.263s52.24x
🐘 PostgresExpress1.106s (-32.4% 🟢)2.013s (~)0.907s53.31x
🐘 PostgresNitro1.164s (+23.4% 🔺)1.618s (+14.8% 🔺)0.454s53.48x
🌐 MongoDBNext.js (Turbopack)1.592s (+1.1%)2.009s (~)0.417s54.76x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.734s (+9.7% 🔺)3.469s (+1.7%)0.734s51.00x
▲ VercelNitro2.923s (+7.7% 🔺)3.679s (+4.0%)0.756s51.07x
▲ VercelNext.js (Turbopack)2.968s (+17.0% 🔺)3.737s (+9.1% 🔺)0.769s51.09x

stress test: Promise.all with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.783s2.036s0.253s151.00x
🌐 RedisNext.js (Turbopack)3.758s4.073s0.315s82.11x
🐘 PostgresNext.js (Turbopack)8.075s8.403s0.328s44.53x
💻 LocalNitro8.217s8.505s0.288s44.61x
🐘 PostgresExpress8.232s8.666s0.434s44.62x
🐘 PostgresNitro8.365s8.860s0.495s44.69x
💻 LocalNext.js (Turbopack)10.060s10.339s0.279s35.64x
💻 LocalExpress11.128s11.607s0.480s36.24x
🌐 MongoDBNext.js (Turbopack)19.788s20.566s0.778s211.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.898s18.865s0.967s21.00x
▲ VercelNitro21.856s22.435s0.579s21.22x
▲ VercelNext.js (Turbopack)23.483s24.076s0.594s21.31x

stress test: Promise.race with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)2.029s2.094s0.065s151.00x
🌐 RedisNext.js (Turbopack)3.906s4.362s0.456s71.93x
🐘 PostgresNext.js (Turbopack)8.845s9.083s0.237s44.36x
🐘 PostgresNitro9.212s9.497s0.285s44.54x
🐘 PostgresExpress9.417s9.854s0.437s44.64x
💻 LocalExpress9.762s10.286s0.524s44.81x
💻 LocalNitro10.275s10.653s0.378s35.06x
💻 LocalNext.js (Turbopack)11.230s11.739s0.509s35.54x
🌐 MongoDBNext.js (Turbopack)20.093s20.520s0.427s29.90x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.370s16.098s0.728s21.00x
▲ VercelNitro15.832s16.430s0.598s21.03x
▲ VercelExpress16.401s16.779s0.377s21.07x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.114s (-37.0% 🟢)0.998s (+0.7%)1.008s (~)0.894s101.00x
🌐 RedisNext.js (Turbopack)0.115s (-19.8% 🟢)1.003s (~)1.011s (~)0.896s101.02x
🌐 StarterNext.js (Turbopack)0.127s (-3.5%)1.004s (~)1.008s (~)0.881s101.12x
💻 LocalNext.js (Turbopack)0.138s (-3.8%)1.002s (~)1.013s (~)0.875s101.22x
💻 LocalExpress0.179s (-1.3%)0.992s (~)1.009s (~)0.830s101.58x
🌐 MongoDBNext.js (Turbopack)0.466s (-2.5%)0.978s (+0.8%)1.011s (~)0.545s104.10x
🐘 PostgresNext.js (Turbopack)0.662s (-20.4% 🟢)0.956s (-30.1% 🟢)1.012s (-28.4% 🟢)0.350s105.84x
🐘 PostgresNitro1.206s (+3.9%)1.833s (-2.4%)2.011s (~)0.805s1010.63x
🐘 PostgresExpress1.453s (-31.0% 🟢)1.587s (-34.8% 🟢)2.011s (-25.9% 🟢)0.558s1012.80x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.424s (+7.5% 🔺)2.842s (+13.3% 🔺)3.254s (+13.9% 🔺)0.830s101.00x
▲ VercelNext.js (Turbopack)2.555s (+9.7% 🔺)2.982s (+25.6% 🔺)3.420s (+22.7% 🔺)0.865s101.05x
▲ VercelNitro2.558s (+11.2% 🔺)3.024s (+13.1% 🔺)3.467s (+11.4% 🔺)0.909s101.06x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro6/7
🐘 PostgresNext.js (Turbopack)7/7
▲ VercelExpress3/7

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/7
Next.js (Turbopack)🌐 Redis4/7
Nitro💻 Local6/7
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)
  • 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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

@github-actions

github-actionsBot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
⚠️ ▲ Vercel Production250010260
✅ 🪟 Windows260026
❌ 🌍 Community Worlds82340116
❌ 📋 Other241126
Total3823511428

❌ Failed Tests

mongodb (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 202 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:255:24
at processTicksAndRejections (node:internal/process/tas
redis (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 200 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:285:25
at processTicksAndRejections (node:internal/process/tas
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(3) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'failed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:647:30
at processTicksAndRejections (node:internal/
starter (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:725:31
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:748:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:784:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:835:36
at processTicksAndRejections (node:intern
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pack
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F98_duplicate_case.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/wo
turso (🌍 Community Worlds): e2e should work with react rendering in step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F8_react_render.tsx&workflowFn=reactWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e promiseAllWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAllWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e promiseRaceWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow
turso (🌍 Community Worlds): e2e promiseAnyWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAnyWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e readableStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=readableStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packag
turso (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=webhookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pac
turso (🌍 Community Worlds): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=sleepingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e nullByteWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=nullByteWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e workflowAndStepMetadataWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=workflowAndStepMetadataWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e outputStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflo
turso (🌍 Community Worlds): e2e outputStreamInsideStepWorkflow - getWritable() called inside step functions

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamInsideStepWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e fetchWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=fetchWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packa
turso (🌍 Community Worlds): e2e promiseRaceStressTestWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceStressTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
turso (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryAttemptCounterWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e retryableAndFatalErrorWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryableAndFatalErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=crossFileErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookCleanupTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionPassingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionWithClosureWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e closureVariableWorkflow - nested step functions with closure variables

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=closureVariableWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=spawnWorkflowFromStepWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
e2e-vercel-prod-fastify (📋 Other): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: STACK_TRACE_ERROR
at task (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:638:27)
at Object.<anonymou

Details by Category

⚠️ ▲ Vercel Production
AppPassedFailedSkipped
⚠️ astro2501
⚠️ example2501
⚠️ express2501
⚠️ hono2501
⚠️ nextjs-turbopack2501
⚠️ nextjs-webpack2501
⚠️ nitro2501
⚠️ nuxt2501
⚠️ sveltekit2501
⚠️ vite2501
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack2600
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb2510
✅ redis-dev300
❌ redis2510
✅ starter-dev300
❌ starter1880
✅ turso-dev300
❌ turso2240
❌ 📋 Other
AppPassedFailedSkipped
❌ e2e-vercel-prod-fastify2411

⚠️Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygpGraphite App

pranaygp commented Dec 5, 2025

Copy link
Copy Markdown
ContributorAuthor

CopilotAI 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.

Pull request overview

This PR adds stress test benchmarks to reproduce and measure performance issues with Promise.race and Promise.all when handling hundreds to thousands of concurrent steps. The benchmarks test workflow execution at 100, 500, and 1000 concurrent step scales.

  • Adds two new stress test workflow functions to isolate concurrent step tracking overhead
  • Introduces six new benchmark tests (3 for Promise.all, 3 for Promise.race) at different scales
  • Uses longer timeout durations and fewer iterations for larger tests to accommodate potential performance degradation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
workbench/example/workflows/97_bench.tsAdds stressTestStep, promiseAllStressTestWorkflow, and promiseRaceStressTestLargeWorkflow to test concurrent step handling at scale
packages/core/e2e/bench.bench.tsAdds 6 new benchmark tests for Promise.all and Promise.race patterns with 100/500/1000 concurrent steps, using appropriate timeout and iteration configurations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +121 to +123
const result = await Promise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);

CopilotAIDec 5, 2025

Copy link

Choose a reason for hiding this comment

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

The Promise.race pattern has a logical bug. The Map is keyed by index i, but runningTasks.delete(result) attempts to delete using the result value (which equals i since stressTestStep(i) returns i). While this happens to work when result equals the key, it creates a tight coupling and will fail if the step returns any value different from its input.

Additionally, this doesn't correctly track which promise completed. Since multiple tasks can have the same result value, deleting by result could remove the wrong task or fail to remove any task if the result doesn't match a key.

Consider using Promise.race with an array of objects that include both the promise and its key:

construnningTasks=newMap<number,Promise<number>>();for(leti=0;i<count;i++){runningTasks.set(i,stressTestStep(i));}constdone: number[]=[];while(runningTasks.size>0){constentries=Array.from(runningTasks.entries());constracePromises=entries.map(([key,promise])=>promise.then(result=>({ key, result })));const{ key, result }=awaitPromise.race(racePromises);done.push(result);runningTasks.delete(key);}
Suggested change
constresult=awaitPromise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);
constentries=Array.from(runningTasks.entries());
constracePromises=entries.map(([key,promise])=>
promise.then(result=>({ key, result }))
);
const{ key, result }=awaitPromise.race(racePromises);
done.push(result);
runningTasks.delete(key);

Copilot uses AI. Check for mistakes.
pranaygpand others added 5 commits December 4, 2025 22:13
Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.
New workflows:
- promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
- promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern
New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add in-memory cache for file existence checks to avoid expensive fs.access() calls
- Increase default concurrency limit from 20 to 100
- Improve HTTP connection pooling (100 connections, 30s keep-alive)
These optimizations significantly improve performance when running workflows
with many concurrent steps (100+).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Skip warmup iterations and run only 1 sample for stress tests
to reduce CI time while still catching the reported issue.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Temporarily skip the high-concurrency benchmarks (500/1000 steps) to
avoid CI issues while we implement performance optimizations.
See beads issue wrk-fyx for the optimization plan.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
{ time: 60000, iterations: 1, warmupIterations: 0, teardown }
);

// TODO: Re-enable after performance optimizations (see beads issue wrk-fyx)

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.

Should we also be stress testing for Promise.allSettled?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Can add more in a future PR but should be no different than Promise.all where everything succeeds

Will need to add a new step that throws errors too, to stress test retrying steps that fail

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I'm gonna make sure these tests are performant with the incoming PRs, and make sure they don't break (hence why I disabled 500 and 1k) and then will add more teats

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.

4 participants

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

Add stress test benchmarks for large concurrent step counts - #539

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts
Dec 5, 2025
Merged

Add stress test benchmarks for large concurrent step counts#539
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.

New workflows:

  • promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
  • promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern

New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

CopilotAI review requested due to automatic review settings December 5, 2025 00:25
@changeset-bot

changeset-botBot commented Dec 5, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9487c93

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

This PR includes changesets to release 14 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@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 Dec 5, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 5, 2025

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🥇 Nitro0.030s (-31.6% 🟢)1.007s (~)0.976s101.00x
🌐 RedisNext.js (Turbopack)0.037s (-9.0% 🟢)1.019s (~)0.983s101.21x
🌐 StarterNext.js (Turbopack)0.040s (+16.1% 🔺)1.015s (~)0.975s101.31x
💻 LocalNext.js (Turbopack)0.041s (+1.5%)1.016s (~)0.975s101.36x
💻 LocalExpress0.044s (-1.6%)1.008s (~)0.964s101.45x
🐘 PostgresNext.js (Turbopack)0.123s (-46.7% 🟢)1.018s (~)0.895s104.06x
🌐 MongoDBNext.js (Turbopack)0.129s (+99.4% 🔺)1.016s (~)0.888s104.24x
🐘 PostgresNitro0.248s (+27.6% 🔺)1.023s (-0.8%)0.775s108.20x
🐘 PostgresExpress0.378s (+32.5% 🔺)1.012s (~)0.634s1012.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.602s (+20.6% 🔺)1.592s (+11.9% 🔺)0.991s101.00x
▲ VercelExpress0.642s (+38.4% 🔺)1.517s (+8.8% 🔺)0.875s101.07x
▲ VercelNext.js (Turbopack)0.745s (+12.9% 🔺)1.695s (+0.6%)0.950s101.24x

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.076s (-32.0% 🟢)1.006s (~)0.930s101.00x
🌐 RedisNext.js (Turbopack)0.078s (-20.9% 🟢)1.013s (~)0.935s101.03x
🌐 StarterNext.js (Turbopack)0.081s (+2.1%)1.011s (~)0.930s101.07x
💻 LocalNext.js (Turbopack)0.086s (-6.3% 🟢)1.010s (~)0.924s101.14x
💻 LocalExpress0.113s (~)1.006s (~)0.894s101.49x
🌐 MongoDBNext.js (Turbopack)0.312s (-1.1%)1.012s (~)0.699s104.13x
🐘 PostgresNext.js (Turbopack)0.942s (+8.7% 🔺)1.115s (+10.0% 🔺)0.173s1012.44x
🐘 PostgresNitro1.131s (-22.9% 🟢)2.012s (~)0.881s1014.94x
🐘 PostgresExpress1.251s (+9.0% 🔺)2.009s (~)0.759s1016.52x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.522s (+8.6% 🔺)2.603s (+8.1% 🔺)1.081s101.00x
▲ VercelExpress1.535s (+8.2% 🔺)2.462s (+3.6%)0.927s101.01x
▲ VercelNitro1.599s (+20.5% 🔺)2.599s (+7.8% 🔺)1.000s101.05x

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.506s (-34.7% 🟢)1.005s (~)0.499s51.00x
🌐 RedisNext.js (Turbopack)0.514s (-16.2% 🟢)1.012s (~)0.499s51.02x
🌐 StarterNext.js (Turbopack)0.580s (~)1.010s (~)0.429s51.15x
💻 LocalNext.js (Turbopack)0.613s (+0.6%)1.009s (~)0.396s51.21x
💻 LocalExpress0.771s (-0.8%)1.006s (~)0.235s51.52x
🌐 MongoDBNext.js (Turbopack)2.129s (-1.4%)3.013s (~)0.884s54.21x
🐘 PostgresNext.js (Turbopack)5.013s (-4.5%)5.216s (-13.4% 🟢)0.203s59.91x
🐘 PostgresNitro8.253s (+54.4% 🔺)8.617s (+43.2% 🔺)0.364s516.32x
🐘 PostgresExpress9.256s (-11.2% 🟢)10.018s (-9.1% 🟢)0.762s518.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro10.274s (-38.3% 🟢)10.904s (-36.0% 🟢)0.630s51.00x
▲ VercelNext.js (Turbopack)10.365s (+6.9% 🔺)11.236s (+8.0% 🔺)0.871s51.01x
▲ VercelExpress10.740s (+6.7% 🔺)11.328s (+7.3% 🔺)0.588s51.05x

workflow with 10 parallel steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.335s (-15.5% 🟢)1.005s (~)0.671s51.00x
🌐 StarterNext.js (Turbopack)0.365s (+2.2%)1.008s (~)0.644s51.09x
💻 LocalNext.js (Turbopack)0.372s (-9.6% 🟢)1.009s (~)0.637s51.11x
🌐 RedisNext.js (Turbopack)0.379s (+6.5% 🔺)1.011s (~)0.632s51.13x
💻 LocalExpress0.419s (-1.3%)1.006s (~)0.588s51.25x
🐘 PostgresNext.js (Turbopack)0.750s (-9.2% 🟢)1.013s (-16.5% 🟢)0.263s52.24x
🐘 PostgresExpress1.106s (-32.4% 🟢)2.013s (~)0.907s53.31x
🐘 PostgresNitro1.164s (+23.4% 🔺)1.618s (+14.8% 🔺)0.454s53.48x
🌐 MongoDBNext.js (Turbopack)1.592s (+1.1%)2.009s (~)0.417s54.76x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.734s (+9.7% 🔺)3.469s (+1.7%)0.734s51.00x
▲ VercelNitro2.923s (+7.7% 🔺)3.679s (+4.0%)0.756s51.07x
▲ VercelNext.js (Turbopack)2.968s (+17.0% 🔺)3.737s (+9.1% 🔺)0.769s51.09x

stress test: Promise.all with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.783s2.036s0.253s151.00x
🌐 RedisNext.js (Turbopack)3.758s4.073s0.315s82.11x
🐘 PostgresNext.js (Turbopack)8.075s8.403s0.328s44.53x
💻 LocalNitro8.217s8.505s0.288s44.61x
🐘 PostgresExpress8.232s8.666s0.434s44.62x
🐘 PostgresNitro8.365s8.860s0.495s44.69x
💻 LocalNext.js (Turbopack)10.060s10.339s0.279s35.64x
💻 LocalExpress11.128s11.607s0.480s36.24x
🌐 MongoDBNext.js (Turbopack)19.788s20.566s0.778s211.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.898s18.865s0.967s21.00x
▲ VercelNitro21.856s22.435s0.579s21.22x
▲ VercelNext.js (Turbopack)23.483s24.076s0.594s21.31x

stress test: Promise.race with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)2.029s2.094s0.065s151.00x
🌐 RedisNext.js (Turbopack)3.906s4.362s0.456s71.93x
🐘 PostgresNext.js (Turbopack)8.845s9.083s0.237s44.36x
🐘 PostgresNitro9.212s9.497s0.285s44.54x
🐘 PostgresExpress9.417s9.854s0.437s44.64x
💻 LocalExpress9.762s10.286s0.524s44.81x
💻 LocalNitro10.275s10.653s0.378s35.06x
💻 LocalNext.js (Turbopack)11.230s11.739s0.509s35.54x
🌐 MongoDBNext.js (Turbopack)20.093s20.520s0.427s29.90x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.370s16.098s0.728s21.00x
▲ VercelNitro15.832s16.430s0.598s21.03x
▲ VercelExpress16.401s16.779s0.377s21.07x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.114s (-37.0% 🟢)0.998s (+0.7%)1.008s (~)0.894s101.00x
🌐 RedisNext.js (Turbopack)0.115s (-19.8% 🟢)1.003s (~)1.011s (~)0.896s101.02x
🌐 StarterNext.js (Turbopack)0.127s (-3.5%)1.004s (~)1.008s (~)0.881s101.12x
💻 LocalNext.js (Turbopack)0.138s (-3.8%)1.002s (~)1.013s (~)0.875s101.22x
💻 LocalExpress0.179s (-1.3%)0.992s (~)1.009s (~)0.830s101.58x
🌐 MongoDBNext.js (Turbopack)0.466s (-2.5%)0.978s (+0.8%)1.011s (~)0.545s104.10x
🐘 PostgresNext.js (Turbopack)0.662s (-20.4% 🟢)0.956s (-30.1% 🟢)1.012s (-28.4% 🟢)0.350s105.84x
🐘 PostgresNitro1.206s (+3.9%)1.833s (-2.4%)2.011s (~)0.805s1010.63x
🐘 PostgresExpress1.453s (-31.0% 🟢)1.587s (-34.8% 🟢)2.011s (-25.9% 🟢)0.558s1012.80x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.424s (+7.5% 🔺)2.842s (+13.3% 🔺)3.254s (+13.9% 🔺)0.830s101.00x
▲ VercelNext.js (Turbopack)2.555s (+9.7% 🔺)2.982s (+25.6% 🔺)3.420s (+22.7% 🔺)0.865s101.05x
▲ VercelNitro2.558s (+11.2% 🔺)3.024s (+13.1% 🔺)3.467s (+11.4% 🔺)0.909s101.06x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro6/7
🐘 PostgresNext.js (Turbopack)7/7
▲ VercelExpress3/7

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/7
Next.js (Turbopack)🌐 Redis4/7
Nitro💻 Local6/7
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)
  • 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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

@github-actions

github-actionsBot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
⚠️ ▲ Vercel Production250010260
✅ 🪟 Windows260026
❌ 🌍 Community Worlds82340116
❌ 📋 Other241126
Total3823511428

❌ Failed Tests

mongodb (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 202 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:255:24
at processTicksAndRejections (node:internal/process/tas
redis (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 200 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:285:25
at processTicksAndRejections (node:internal/process/tas
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(3) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'failed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:647:30
at processTicksAndRejections (node:internal/
starter (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:725:31
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:748:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:784:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:835:36
at processTicksAndRejections (node:intern
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pack
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F98_duplicate_case.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/wo
turso (🌍 Community Worlds): e2e should work with react rendering in step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F8_react_render.tsx&workflowFn=reactWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e promiseAllWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAllWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e promiseRaceWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow
turso (🌍 Community Worlds): e2e promiseAnyWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAnyWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e readableStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=readableStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packag
turso (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=webhookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pac
turso (🌍 Community Worlds): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=sleepingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e nullByteWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=nullByteWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e workflowAndStepMetadataWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=workflowAndStepMetadataWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e outputStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflo
turso (🌍 Community Worlds): e2e outputStreamInsideStepWorkflow - getWritable() called inside step functions

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamInsideStepWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e fetchWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=fetchWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packa
turso (🌍 Community Worlds): e2e promiseRaceStressTestWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceStressTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
turso (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryAttemptCounterWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e retryableAndFatalErrorWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryableAndFatalErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=crossFileErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookCleanupTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionPassingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionWithClosureWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e closureVariableWorkflow - nested step functions with closure variables

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=closureVariableWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=spawnWorkflowFromStepWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
e2e-vercel-prod-fastify (📋 Other): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: STACK_TRACE_ERROR
at task (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:638:27)
at Object.<anonymou

Details by Category

⚠️ ▲ Vercel Production
AppPassedFailedSkipped
⚠️ astro2501
⚠️ example2501
⚠️ express2501
⚠️ hono2501
⚠️ nextjs-turbopack2501
⚠️ nextjs-webpack2501
⚠️ nitro2501
⚠️ nuxt2501
⚠️ sveltekit2501
⚠️ vite2501
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack2600
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb2510
✅ redis-dev300
❌ redis2510
✅ starter-dev300
❌ starter1880
✅ turso-dev300
❌ turso2240
❌ 📋 Other
AppPassedFailedSkipped
❌ e2e-vercel-prod-fastify2411

⚠️Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygpGraphite App

pranaygp commented Dec 5, 2025

Copy link
Copy Markdown
ContributorAuthor

CopilotAI 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.

Pull request overview

This PR adds stress test benchmarks to reproduce and measure performance issues with Promise.race and Promise.all when handling hundreds to thousands of concurrent steps. The benchmarks test workflow execution at 100, 500, and 1000 concurrent step scales.

  • Adds two new stress test workflow functions to isolate concurrent step tracking overhead
  • Introduces six new benchmark tests (3 for Promise.all, 3 for Promise.race) at different scales
  • Uses longer timeout durations and fewer iterations for larger tests to accommodate potential performance degradation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
workbench/example/workflows/97_bench.tsAdds stressTestStep, promiseAllStressTestWorkflow, and promiseRaceStressTestLargeWorkflow to test concurrent step handling at scale
packages/core/e2e/bench.bench.tsAdds 6 new benchmark tests for Promise.all and Promise.race patterns with 100/500/1000 concurrent steps, using appropriate timeout and iteration configurations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +121 to +123
const result = await Promise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);

CopilotAIDec 5, 2025

Copy link

Choose a reason for hiding this comment

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

The Promise.race pattern has a logical bug. The Map is keyed by index i, but runningTasks.delete(result) attempts to delete using the result value (which equals i since stressTestStep(i) returns i). While this happens to work when result equals the key, it creates a tight coupling and will fail if the step returns any value different from its input.

Additionally, this doesn't correctly track which promise completed. Since multiple tasks can have the same result value, deleting by result could remove the wrong task or fail to remove any task if the result doesn't match a key.

Consider using Promise.race with an array of objects that include both the promise and its key:

construnningTasks=newMap<number,Promise<number>>();for(leti=0;i<count;i++){runningTasks.set(i,stressTestStep(i));}constdone: number[]=[];while(runningTasks.size>0){constentries=Array.from(runningTasks.entries());constracePromises=entries.map(([key,promise])=>promise.then(result=>({ key, result })));const{ key, result }=awaitPromise.race(racePromises);done.push(result);runningTasks.delete(key);}
Suggested change
constresult=awaitPromise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);
constentries=Array.from(runningTasks.entries());
constracePromises=entries.map(([key,promise])=>
promise.then(result=>({ key, result }))
);
const{ key, result }=awaitPromise.race(racePromises);
done.push(result);
runningTasks.delete(key);

Copilot uses AI. Check for mistakes.
pranaygpand others added 5 commits December 4, 2025 22:13
Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.
New workflows:
- promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
- promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern
New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add in-memory cache for file existence checks to avoid expensive fs.access() calls
- Increase default concurrency limit from 20 to 100
- Improve HTTP connection pooling (100 connections, 30s keep-alive)
These optimizations significantly improve performance when running workflows
with many concurrent steps (100+).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Skip warmup iterations and run only 1 sample for stress tests
to reduce CI time while still catching the reported issue.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Temporarily skip the high-concurrency benchmarks (500/1000 steps) to
avoid CI issues while we implement performance optimizations.
See beads issue wrk-fyx for the optimization plan.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
{ time: 60000, iterations: 1, warmupIterations: 0, teardown }
);

// TODO: Re-enable after performance optimizations (see beads issue wrk-fyx)

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.

Should we also be stress testing for Promise.allSettled?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Can add more in a future PR but should be no different than Promise.all where everything succeeds

Will need to add a new step that throws errors too, to stress test retrying steps that fail

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I'm gonna make sure these tests are performant with the incoming PRs, and make sure they don't break (hence why I disabled 500 and 1k) and then will add more teats

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.

4 participants

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

Add stress test benchmarks for large concurrent step counts - #539

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts
Dec 5, 2025
Merged

Add stress test benchmarks for large concurrent step counts#539
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.

New workflows:

  • promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
  • promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern

New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

CopilotAI review requested due to automatic review settings December 5, 2025 00:25
@changeset-bot

changeset-botBot commented Dec 5, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9487c93

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

This PR includes changesets to release 14 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@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 Dec 5, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 5, 2025

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🥇 Nitro0.030s (-31.6% 🟢)1.007s (~)0.976s101.00x
🌐 RedisNext.js (Turbopack)0.037s (-9.0% 🟢)1.019s (~)0.983s101.21x
🌐 StarterNext.js (Turbopack)0.040s (+16.1% 🔺)1.015s (~)0.975s101.31x
💻 LocalNext.js (Turbopack)0.041s (+1.5%)1.016s (~)0.975s101.36x
💻 LocalExpress0.044s (-1.6%)1.008s (~)0.964s101.45x
🐘 PostgresNext.js (Turbopack)0.123s (-46.7% 🟢)1.018s (~)0.895s104.06x
🌐 MongoDBNext.js (Turbopack)0.129s (+99.4% 🔺)1.016s (~)0.888s104.24x
🐘 PostgresNitro0.248s (+27.6% 🔺)1.023s (-0.8%)0.775s108.20x
🐘 PostgresExpress0.378s (+32.5% 🔺)1.012s (~)0.634s1012.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.602s (+20.6% 🔺)1.592s (+11.9% 🔺)0.991s101.00x
▲ VercelExpress0.642s (+38.4% 🔺)1.517s (+8.8% 🔺)0.875s101.07x
▲ VercelNext.js (Turbopack)0.745s (+12.9% 🔺)1.695s (+0.6%)0.950s101.24x

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.076s (-32.0% 🟢)1.006s (~)0.930s101.00x
🌐 RedisNext.js (Turbopack)0.078s (-20.9% 🟢)1.013s (~)0.935s101.03x
🌐 StarterNext.js (Turbopack)0.081s (+2.1%)1.011s (~)0.930s101.07x
💻 LocalNext.js (Turbopack)0.086s (-6.3% 🟢)1.010s (~)0.924s101.14x
💻 LocalExpress0.113s (~)1.006s (~)0.894s101.49x
🌐 MongoDBNext.js (Turbopack)0.312s (-1.1%)1.012s (~)0.699s104.13x
🐘 PostgresNext.js (Turbopack)0.942s (+8.7% 🔺)1.115s (+10.0% 🔺)0.173s1012.44x
🐘 PostgresNitro1.131s (-22.9% 🟢)2.012s (~)0.881s1014.94x
🐘 PostgresExpress1.251s (+9.0% 🔺)2.009s (~)0.759s1016.52x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.522s (+8.6% 🔺)2.603s (+8.1% 🔺)1.081s101.00x
▲ VercelExpress1.535s (+8.2% 🔺)2.462s (+3.6%)0.927s101.01x
▲ VercelNitro1.599s (+20.5% 🔺)2.599s (+7.8% 🔺)1.000s101.05x

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.506s (-34.7% 🟢)1.005s (~)0.499s51.00x
🌐 RedisNext.js (Turbopack)0.514s (-16.2% 🟢)1.012s (~)0.499s51.02x
🌐 StarterNext.js (Turbopack)0.580s (~)1.010s (~)0.429s51.15x
💻 LocalNext.js (Turbopack)0.613s (+0.6%)1.009s (~)0.396s51.21x
💻 LocalExpress0.771s (-0.8%)1.006s (~)0.235s51.52x
🌐 MongoDBNext.js (Turbopack)2.129s (-1.4%)3.013s (~)0.884s54.21x
🐘 PostgresNext.js (Turbopack)5.013s (-4.5%)5.216s (-13.4% 🟢)0.203s59.91x
🐘 PostgresNitro8.253s (+54.4% 🔺)8.617s (+43.2% 🔺)0.364s516.32x
🐘 PostgresExpress9.256s (-11.2% 🟢)10.018s (-9.1% 🟢)0.762s518.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro10.274s (-38.3% 🟢)10.904s (-36.0% 🟢)0.630s51.00x
▲ VercelNext.js (Turbopack)10.365s (+6.9% 🔺)11.236s (+8.0% 🔺)0.871s51.01x
▲ VercelExpress10.740s (+6.7% 🔺)11.328s (+7.3% 🔺)0.588s51.05x

workflow with 10 parallel steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.335s (-15.5% 🟢)1.005s (~)0.671s51.00x
🌐 StarterNext.js (Turbopack)0.365s (+2.2%)1.008s (~)0.644s51.09x
💻 LocalNext.js (Turbopack)0.372s (-9.6% 🟢)1.009s (~)0.637s51.11x
🌐 RedisNext.js (Turbopack)0.379s (+6.5% 🔺)1.011s (~)0.632s51.13x
💻 LocalExpress0.419s (-1.3%)1.006s (~)0.588s51.25x
🐘 PostgresNext.js (Turbopack)0.750s (-9.2% 🟢)1.013s (-16.5% 🟢)0.263s52.24x
🐘 PostgresExpress1.106s (-32.4% 🟢)2.013s (~)0.907s53.31x
🐘 PostgresNitro1.164s (+23.4% 🔺)1.618s (+14.8% 🔺)0.454s53.48x
🌐 MongoDBNext.js (Turbopack)1.592s (+1.1%)2.009s (~)0.417s54.76x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.734s (+9.7% 🔺)3.469s (+1.7%)0.734s51.00x
▲ VercelNitro2.923s (+7.7% 🔺)3.679s (+4.0%)0.756s51.07x
▲ VercelNext.js (Turbopack)2.968s (+17.0% 🔺)3.737s (+9.1% 🔺)0.769s51.09x

stress test: Promise.all with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.783s2.036s0.253s151.00x
🌐 RedisNext.js (Turbopack)3.758s4.073s0.315s82.11x
🐘 PostgresNext.js (Turbopack)8.075s8.403s0.328s44.53x
💻 LocalNitro8.217s8.505s0.288s44.61x
🐘 PostgresExpress8.232s8.666s0.434s44.62x
🐘 PostgresNitro8.365s8.860s0.495s44.69x
💻 LocalNext.js (Turbopack)10.060s10.339s0.279s35.64x
💻 LocalExpress11.128s11.607s0.480s36.24x
🌐 MongoDBNext.js (Turbopack)19.788s20.566s0.778s211.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.898s18.865s0.967s21.00x
▲ VercelNitro21.856s22.435s0.579s21.22x
▲ VercelNext.js (Turbopack)23.483s24.076s0.594s21.31x

stress test: Promise.race with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)2.029s2.094s0.065s151.00x
🌐 RedisNext.js (Turbopack)3.906s4.362s0.456s71.93x
🐘 PostgresNext.js (Turbopack)8.845s9.083s0.237s44.36x
🐘 PostgresNitro9.212s9.497s0.285s44.54x
🐘 PostgresExpress9.417s9.854s0.437s44.64x
💻 LocalExpress9.762s10.286s0.524s44.81x
💻 LocalNitro10.275s10.653s0.378s35.06x
💻 LocalNext.js (Turbopack)11.230s11.739s0.509s35.54x
🌐 MongoDBNext.js (Turbopack)20.093s20.520s0.427s29.90x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.370s16.098s0.728s21.00x
▲ VercelNitro15.832s16.430s0.598s21.03x
▲ VercelExpress16.401s16.779s0.377s21.07x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.114s (-37.0% 🟢)0.998s (+0.7%)1.008s (~)0.894s101.00x
🌐 RedisNext.js (Turbopack)0.115s (-19.8% 🟢)1.003s (~)1.011s (~)0.896s101.02x
🌐 StarterNext.js (Turbopack)0.127s (-3.5%)1.004s (~)1.008s (~)0.881s101.12x
💻 LocalNext.js (Turbopack)0.138s (-3.8%)1.002s (~)1.013s (~)0.875s101.22x
💻 LocalExpress0.179s (-1.3%)0.992s (~)1.009s (~)0.830s101.58x
🌐 MongoDBNext.js (Turbopack)0.466s (-2.5%)0.978s (+0.8%)1.011s (~)0.545s104.10x
🐘 PostgresNext.js (Turbopack)0.662s (-20.4% 🟢)0.956s (-30.1% 🟢)1.012s (-28.4% 🟢)0.350s105.84x
🐘 PostgresNitro1.206s (+3.9%)1.833s (-2.4%)2.011s (~)0.805s1010.63x
🐘 PostgresExpress1.453s (-31.0% 🟢)1.587s (-34.8% 🟢)2.011s (-25.9% 🟢)0.558s1012.80x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.424s (+7.5% 🔺)2.842s (+13.3% 🔺)3.254s (+13.9% 🔺)0.830s101.00x
▲ VercelNext.js (Turbopack)2.555s (+9.7% 🔺)2.982s (+25.6% 🔺)3.420s (+22.7% 🔺)0.865s101.05x
▲ VercelNitro2.558s (+11.2% 🔺)3.024s (+13.1% 🔺)3.467s (+11.4% 🔺)0.909s101.06x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro6/7
🐘 PostgresNext.js (Turbopack)7/7
▲ VercelExpress3/7

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/7
Next.js (Turbopack)🌐 Redis4/7
Nitro💻 Local6/7
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)
  • 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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

@github-actions

github-actionsBot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
⚠️ ▲ Vercel Production250010260
✅ 🪟 Windows260026
❌ 🌍 Community Worlds82340116
❌ 📋 Other241126
Total3823511428

❌ Failed Tests

mongodb (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 202 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:255:24
at processTicksAndRejections (node:internal/process/tas
redis (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 200 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:285:25
at processTicksAndRejections (node:internal/process/tas
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(3) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'failed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:647:30
at processTicksAndRejections (node:internal/
starter (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:725:31
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:748:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:784:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:835:36
at processTicksAndRejections (node:intern
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pack
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F98_duplicate_case.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/wo
turso (🌍 Community Worlds): e2e should work with react rendering in step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F8_react_render.tsx&workflowFn=reactWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e promiseAllWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAllWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e promiseRaceWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow
turso (🌍 Community Worlds): e2e promiseAnyWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAnyWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e readableStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=readableStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packag
turso (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=webhookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pac
turso (🌍 Community Worlds): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=sleepingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e nullByteWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=nullByteWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e workflowAndStepMetadataWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=workflowAndStepMetadataWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e outputStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflo
turso (🌍 Community Worlds): e2e outputStreamInsideStepWorkflow - getWritable() called inside step functions

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamInsideStepWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e fetchWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=fetchWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packa
turso (🌍 Community Worlds): e2e promiseRaceStressTestWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceStressTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
turso (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryAttemptCounterWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e retryableAndFatalErrorWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryableAndFatalErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=crossFileErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookCleanupTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionPassingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionWithClosureWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e closureVariableWorkflow - nested step functions with closure variables

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=closureVariableWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=spawnWorkflowFromStepWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
e2e-vercel-prod-fastify (📋 Other): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: STACK_TRACE_ERROR
at task (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:638:27)
at Object.<anonymou

Details by Category

⚠️ ▲ Vercel Production
AppPassedFailedSkipped
⚠️ astro2501
⚠️ example2501
⚠️ express2501
⚠️ hono2501
⚠️ nextjs-turbopack2501
⚠️ nextjs-webpack2501
⚠️ nitro2501
⚠️ nuxt2501
⚠️ sveltekit2501
⚠️ vite2501
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack2600
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb2510
✅ redis-dev300
❌ redis2510
✅ starter-dev300
❌ starter1880
✅ turso-dev300
❌ turso2240
❌ 📋 Other
AppPassedFailedSkipped
❌ e2e-vercel-prod-fastify2411

⚠️Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygpGraphite App

pranaygp commented Dec 5, 2025

Copy link
Copy Markdown
ContributorAuthor

CopilotAI 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.

Pull request overview

This PR adds stress test benchmarks to reproduce and measure performance issues with Promise.race and Promise.all when handling hundreds to thousands of concurrent steps. The benchmarks test workflow execution at 100, 500, and 1000 concurrent step scales.

  • Adds two new stress test workflow functions to isolate concurrent step tracking overhead
  • Introduces six new benchmark tests (3 for Promise.all, 3 for Promise.race) at different scales
  • Uses longer timeout durations and fewer iterations for larger tests to accommodate potential performance degradation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
workbench/example/workflows/97_bench.tsAdds stressTestStep, promiseAllStressTestWorkflow, and promiseRaceStressTestLargeWorkflow to test concurrent step handling at scale
packages/core/e2e/bench.bench.tsAdds 6 new benchmark tests for Promise.all and Promise.race patterns with 100/500/1000 concurrent steps, using appropriate timeout and iteration configurations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +121 to +123
const result = await Promise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);

CopilotAIDec 5, 2025

Copy link

Choose a reason for hiding this comment

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

The Promise.race pattern has a logical bug. The Map is keyed by index i, but runningTasks.delete(result) attempts to delete using the result value (which equals i since stressTestStep(i) returns i). While this happens to work when result equals the key, it creates a tight coupling and will fail if the step returns any value different from its input.

Additionally, this doesn't correctly track which promise completed. Since multiple tasks can have the same result value, deleting by result could remove the wrong task or fail to remove any task if the result doesn't match a key.

Consider using Promise.race with an array of objects that include both the promise and its key:

construnningTasks=newMap<number,Promise<number>>();for(leti=0;i<count;i++){runningTasks.set(i,stressTestStep(i));}constdone: number[]=[];while(runningTasks.size>0){constentries=Array.from(runningTasks.entries());constracePromises=entries.map(([key,promise])=>promise.then(result=>({ key, result })));const{ key, result }=awaitPromise.race(racePromises);done.push(result);runningTasks.delete(key);}
Suggested change
constresult=awaitPromise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);
constentries=Array.from(runningTasks.entries());
constracePromises=entries.map(([key,promise])=>
promise.then(result=>({ key, result }))
);
const{ key, result }=awaitPromise.race(racePromises);
done.push(result);
runningTasks.delete(key);

Copilot uses AI. Check for mistakes.
pranaygpand others added 5 commits December 4, 2025 22:13
Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.
New workflows:
- promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
- promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern
New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add in-memory cache for file existence checks to avoid expensive fs.access() calls
- Increase default concurrency limit from 20 to 100
- Improve HTTP connection pooling (100 connections, 30s keep-alive)
These optimizations significantly improve performance when running workflows
with many concurrent steps (100+).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Skip warmup iterations and run only 1 sample for stress tests
to reduce CI time while still catching the reported issue.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Temporarily skip the high-concurrency benchmarks (500/1000 steps) to
avoid CI issues while we implement performance optimizations.
See beads issue wrk-fyx for the optimization plan.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
{ time: 60000, iterations: 1, warmupIterations: 0, teardown }
);

// TODO: Re-enable after performance optimizations (see beads issue wrk-fyx)

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.

Should we also be stress testing for Promise.allSettled?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Can add more in a future PR but should be no different than Promise.all where everything succeeds

Will need to add a new step that throws errors too, to stress test retrying steps that fail

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I'm gonna make sure these tests are performant with the incoming PRs, and make sure they don't break (hence why I disabled 500 and 1k) and then will add more teats

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.

4 participants

@pranaygp@VaguelySerious@karthikscale3
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Add stress test benchmarks for large concurrent step counts - #539

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts
Dec 5, 2025
Merged

Add stress test benchmarks for large concurrent step counts#539
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.

New workflows:

  • promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
  • promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern

New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

CopilotAI review requested due to automatic review settings December 5, 2025 00:25
@changeset-bot

changeset-botBot commented Dec 5, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9487c93

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

This PR includes changesets to release 14 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@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 Dec 5, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 5, 2025

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🥇 Nitro0.030s (-31.6% 🟢)1.007s (~)0.976s101.00x
🌐 RedisNext.js (Turbopack)0.037s (-9.0% 🟢)1.019s (~)0.983s101.21x
🌐 StarterNext.js (Turbopack)0.040s (+16.1% 🔺)1.015s (~)0.975s101.31x
💻 LocalNext.js (Turbopack)0.041s (+1.5%)1.016s (~)0.975s101.36x
💻 LocalExpress0.044s (-1.6%)1.008s (~)0.964s101.45x
🐘 PostgresNext.js (Turbopack)0.123s (-46.7% 🟢)1.018s (~)0.895s104.06x
🌐 MongoDBNext.js (Turbopack)0.129s (+99.4% 🔺)1.016s (~)0.888s104.24x
🐘 PostgresNitro0.248s (+27.6% 🔺)1.023s (-0.8%)0.775s108.20x
🐘 PostgresExpress0.378s (+32.5% 🔺)1.012s (~)0.634s1012.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.602s (+20.6% 🔺)1.592s (+11.9% 🔺)0.991s101.00x
▲ VercelExpress0.642s (+38.4% 🔺)1.517s (+8.8% 🔺)0.875s101.07x
▲ VercelNext.js (Turbopack)0.745s (+12.9% 🔺)1.695s (+0.6%)0.950s101.24x

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.076s (-32.0% 🟢)1.006s (~)0.930s101.00x
🌐 RedisNext.js (Turbopack)0.078s (-20.9% 🟢)1.013s (~)0.935s101.03x
🌐 StarterNext.js (Turbopack)0.081s (+2.1%)1.011s (~)0.930s101.07x
💻 LocalNext.js (Turbopack)0.086s (-6.3% 🟢)1.010s (~)0.924s101.14x
💻 LocalExpress0.113s (~)1.006s (~)0.894s101.49x
🌐 MongoDBNext.js (Turbopack)0.312s (-1.1%)1.012s (~)0.699s104.13x
🐘 PostgresNext.js (Turbopack)0.942s (+8.7% 🔺)1.115s (+10.0% 🔺)0.173s1012.44x
🐘 PostgresNitro1.131s (-22.9% 🟢)2.012s (~)0.881s1014.94x
🐘 PostgresExpress1.251s (+9.0% 🔺)2.009s (~)0.759s1016.52x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.522s (+8.6% 🔺)2.603s (+8.1% 🔺)1.081s101.00x
▲ VercelExpress1.535s (+8.2% 🔺)2.462s (+3.6%)0.927s101.01x
▲ VercelNitro1.599s (+20.5% 🔺)2.599s (+7.8% 🔺)1.000s101.05x

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.506s (-34.7% 🟢)1.005s (~)0.499s51.00x
🌐 RedisNext.js (Turbopack)0.514s (-16.2% 🟢)1.012s (~)0.499s51.02x
🌐 StarterNext.js (Turbopack)0.580s (~)1.010s (~)0.429s51.15x
💻 LocalNext.js (Turbopack)0.613s (+0.6%)1.009s (~)0.396s51.21x
💻 LocalExpress0.771s (-0.8%)1.006s (~)0.235s51.52x
🌐 MongoDBNext.js (Turbopack)2.129s (-1.4%)3.013s (~)0.884s54.21x
🐘 PostgresNext.js (Turbopack)5.013s (-4.5%)5.216s (-13.4% 🟢)0.203s59.91x
🐘 PostgresNitro8.253s (+54.4% 🔺)8.617s (+43.2% 🔺)0.364s516.32x
🐘 PostgresExpress9.256s (-11.2% 🟢)10.018s (-9.1% 🟢)0.762s518.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro10.274s (-38.3% 🟢)10.904s (-36.0% 🟢)0.630s51.00x
▲ VercelNext.js (Turbopack)10.365s (+6.9% 🔺)11.236s (+8.0% 🔺)0.871s51.01x
▲ VercelExpress10.740s (+6.7% 🔺)11.328s (+7.3% 🔺)0.588s51.05x

workflow with 10 parallel steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.335s (-15.5% 🟢)1.005s (~)0.671s51.00x
🌐 StarterNext.js (Turbopack)0.365s (+2.2%)1.008s (~)0.644s51.09x
💻 LocalNext.js (Turbopack)0.372s (-9.6% 🟢)1.009s (~)0.637s51.11x
🌐 RedisNext.js (Turbopack)0.379s (+6.5% 🔺)1.011s (~)0.632s51.13x
💻 LocalExpress0.419s (-1.3%)1.006s (~)0.588s51.25x
🐘 PostgresNext.js (Turbopack)0.750s (-9.2% 🟢)1.013s (-16.5% 🟢)0.263s52.24x
🐘 PostgresExpress1.106s (-32.4% 🟢)2.013s (~)0.907s53.31x
🐘 PostgresNitro1.164s (+23.4% 🔺)1.618s (+14.8% 🔺)0.454s53.48x
🌐 MongoDBNext.js (Turbopack)1.592s (+1.1%)2.009s (~)0.417s54.76x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.734s (+9.7% 🔺)3.469s (+1.7%)0.734s51.00x
▲ VercelNitro2.923s (+7.7% 🔺)3.679s (+4.0%)0.756s51.07x
▲ VercelNext.js (Turbopack)2.968s (+17.0% 🔺)3.737s (+9.1% 🔺)0.769s51.09x

stress test: Promise.all with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.783s2.036s0.253s151.00x
🌐 RedisNext.js (Turbopack)3.758s4.073s0.315s82.11x
🐘 PostgresNext.js (Turbopack)8.075s8.403s0.328s44.53x
💻 LocalNitro8.217s8.505s0.288s44.61x
🐘 PostgresExpress8.232s8.666s0.434s44.62x
🐘 PostgresNitro8.365s8.860s0.495s44.69x
💻 LocalNext.js (Turbopack)10.060s10.339s0.279s35.64x
💻 LocalExpress11.128s11.607s0.480s36.24x
🌐 MongoDBNext.js (Turbopack)19.788s20.566s0.778s211.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.898s18.865s0.967s21.00x
▲ VercelNitro21.856s22.435s0.579s21.22x
▲ VercelNext.js (Turbopack)23.483s24.076s0.594s21.31x

stress test: Promise.race with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)2.029s2.094s0.065s151.00x
🌐 RedisNext.js (Turbopack)3.906s4.362s0.456s71.93x
🐘 PostgresNext.js (Turbopack)8.845s9.083s0.237s44.36x
🐘 PostgresNitro9.212s9.497s0.285s44.54x
🐘 PostgresExpress9.417s9.854s0.437s44.64x
💻 LocalExpress9.762s10.286s0.524s44.81x
💻 LocalNitro10.275s10.653s0.378s35.06x
💻 LocalNext.js (Turbopack)11.230s11.739s0.509s35.54x
🌐 MongoDBNext.js (Turbopack)20.093s20.520s0.427s29.90x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.370s16.098s0.728s21.00x
▲ VercelNitro15.832s16.430s0.598s21.03x
▲ VercelExpress16.401s16.779s0.377s21.07x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.114s (-37.0% 🟢)0.998s (+0.7%)1.008s (~)0.894s101.00x
🌐 RedisNext.js (Turbopack)0.115s (-19.8% 🟢)1.003s (~)1.011s (~)0.896s101.02x
🌐 StarterNext.js (Turbopack)0.127s (-3.5%)1.004s (~)1.008s (~)0.881s101.12x
💻 LocalNext.js (Turbopack)0.138s (-3.8%)1.002s (~)1.013s (~)0.875s101.22x
💻 LocalExpress0.179s (-1.3%)0.992s (~)1.009s (~)0.830s101.58x
🌐 MongoDBNext.js (Turbopack)0.466s (-2.5%)0.978s (+0.8%)1.011s (~)0.545s104.10x
🐘 PostgresNext.js (Turbopack)0.662s (-20.4% 🟢)0.956s (-30.1% 🟢)1.012s (-28.4% 🟢)0.350s105.84x
🐘 PostgresNitro1.206s (+3.9%)1.833s (-2.4%)2.011s (~)0.805s1010.63x
🐘 PostgresExpress1.453s (-31.0% 🟢)1.587s (-34.8% 🟢)2.011s (-25.9% 🟢)0.558s1012.80x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.424s (+7.5% 🔺)2.842s (+13.3% 🔺)3.254s (+13.9% 🔺)0.830s101.00x
▲ VercelNext.js (Turbopack)2.555s (+9.7% 🔺)2.982s (+25.6% 🔺)3.420s (+22.7% 🔺)0.865s101.05x
▲ VercelNitro2.558s (+11.2% 🔺)3.024s (+13.1% 🔺)3.467s (+11.4% 🔺)0.909s101.06x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro6/7
🐘 PostgresNext.js (Turbopack)7/7
▲ VercelExpress3/7

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/7
Next.js (Turbopack)🌐 Redis4/7
Nitro💻 Local6/7
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)
  • 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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

@github-actions

github-actionsBot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
⚠️ ▲ Vercel Production250010260
✅ 🪟 Windows260026
❌ 🌍 Community Worlds82340116
❌ 📋 Other241126
Total3823511428

❌ Failed Tests

mongodb (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 202 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:255:24
at processTicksAndRejections (node:internal/process/tas
redis (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 200 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:285:25
at processTicksAndRejections (node:internal/process/tas
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(3) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'failed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:647:30
at processTicksAndRejections (node:internal/
starter (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:725:31
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:748:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:784:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:835:36
at processTicksAndRejections (node:intern
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pack
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F98_duplicate_case.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/wo
turso (🌍 Community Worlds): e2e should work with react rendering in step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F8_react_render.tsx&workflowFn=reactWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e promiseAllWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAllWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e promiseRaceWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow
turso (🌍 Community Worlds): e2e promiseAnyWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAnyWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e readableStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=readableStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packag
turso (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=webhookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pac
turso (🌍 Community Worlds): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=sleepingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e nullByteWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=nullByteWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e workflowAndStepMetadataWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=workflowAndStepMetadataWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e outputStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflo
turso (🌍 Community Worlds): e2e outputStreamInsideStepWorkflow - getWritable() called inside step functions

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamInsideStepWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e fetchWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=fetchWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packa
turso (🌍 Community Worlds): e2e promiseRaceStressTestWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceStressTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
turso (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryAttemptCounterWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e retryableAndFatalErrorWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryableAndFatalErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=crossFileErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookCleanupTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionPassingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionWithClosureWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e closureVariableWorkflow - nested step functions with closure variables

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=closureVariableWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=spawnWorkflowFromStepWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
e2e-vercel-prod-fastify (📋 Other): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: STACK_TRACE_ERROR
at task (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:638:27)
at Object.<anonymou

Details by Category

⚠️ ▲ Vercel Production
AppPassedFailedSkipped
⚠️ astro2501
⚠️ example2501
⚠️ express2501
⚠️ hono2501
⚠️ nextjs-turbopack2501
⚠️ nextjs-webpack2501
⚠️ nitro2501
⚠️ nuxt2501
⚠️ sveltekit2501
⚠️ vite2501
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack2600
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb2510
✅ redis-dev300
❌ redis2510
✅ starter-dev300
❌ starter1880
✅ turso-dev300
❌ turso2240
❌ 📋 Other
AppPassedFailedSkipped
❌ e2e-vercel-prod-fastify2411

⚠️Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygpGraphite App

pranaygp commented Dec 5, 2025

Copy link
Copy Markdown
ContributorAuthor

CopilotAI 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.

Pull request overview

This PR adds stress test benchmarks to reproduce and measure performance issues with Promise.race and Promise.all when handling hundreds to thousands of concurrent steps. The benchmarks test workflow execution at 100, 500, and 1000 concurrent step scales.

  • Adds two new stress test workflow functions to isolate concurrent step tracking overhead
  • Introduces six new benchmark tests (3 for Promise.all, 3 for Promise.race) at different scales
  • Uses longer timeout durations and fewer iterations for larger tests to accommodate potential performance degradation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
workbench/example/workflows/97_bench.tsAdds stressTestStep, promiseAllStressTestWorkflow, and promiseRaceStressTestLargeWorkflow to test concurrent step handling at scale
packages/core/e2e/bench.bench.tsAdds 6 new benchmark tests for Promise.all and Promise.race patterns with 100/500/1000 concurrent steps, using appropriate timeout and iteration configurations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +121 to +123
const result = await Promise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);

CopilotAIDec 5, 2025

Copy link

Choose a reason for hiding this comment

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

The Promise.race pattern has a logical bug. The Map is keyed by index i, but runningTasks.delete(result) attempts to delete using the result value (which equals i since stressTestStep(i) returns i). While this happens to work when result equals the key, it creates a tight coupling and will fail if the step returns any value different from its input.

Additionally, this doesn't correctly track which promise completed. Since multiple tasks can have the same result value, deleting by result could remove the wrong task or fail to remove any task if the result doesn't match a key.

Consider using Promise.race with an array of objects that include both the promise and its key:

construnningTasks=newMap<number,Promise<number>>();for(leti=0;i<count;i++){runningTasks.set(i,stressTestStep(i));}constdone: number[]=[];while(runningTasks.size>0){constentries=Array.from(runningTasks.entries());constracePromises=entries.map(([key,promise])=>promise.then(result=>({ key, result })));const{ key, result }=awaitPromise.race(racePromises);done.push(result);runningTasks.delete(key);}
Suggested change
constresult=awaitPromise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);
constentries=Array.from(runningTasks.entries());
constracePromises=entries.map(([key,promise])=>
promise.then(result=>({ key, result }))
);
const{ key, result }=awaitPromise.race(racePromises);
done.push(result);
runningTasks.delete(key);

Copilot uses AI. Check for mistakes.
pranaygpand others added 5 commits December 4, 2025 22:13
Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.
New workflows:
- promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
- promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern
New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add in-memory cache for file existence checks to avoid expensive fs.access() calls
- Increase default concurrency limit from 20 to 100
- Improve HTTP connection pooling (100 connections, 30s keep-alive)
These optimizations significantly improve performance when running workflows
with many concurrent steps (100+).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Skip warmup iterations and run only 1 sample for stress tests
to reduce CI time while still catching the reported issue.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Temporarily skip the high-concurrency benchmarks (500/1000 steps) to
avoid CI issues while we implement performance optimizations.
See beads issue wrk-fyx for the optimization plan.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
{ time: 60000, iterations: 1, warmupIterations: 0, teardown }
);

// TODO: Re-enable after performance optimizations (see beads issue wrk-fyx)

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.

Should we also be stress testing for Promise.allSettled?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Can add more in a future PR but should be no different than Promise.all where everything succeeds

Will need to add a new step that throws errors too, to stress test retrying steps that fail

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I'm gonna make sure these tests are performant with the incoming PRs, and make sure they don't break (hence why I disabled 500 and 1k) and then will add more teats

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.

4 participants

@pranaygp@VaguelySerious@karthikscale3
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Add stress test benchmarks for large concurrent step counts - #539

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts
Dec 5, 2025
Merged

Add stress test benchmarks for large concurrent step counts#539
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.

New workflows:

  • promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
  • promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern

New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

CopilotAI review requested due to automatic review settings December 5, 2025 00:25
@changeset-bot

changeset-botBot commented Dec 5, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9487c93

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

This PR includes changesets to release 14 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@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 Dec 5, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 5, 2025

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🥇 Nitro0.030s (-31.6% 🟢)1.007s (~)0.976s101.00x
🌐 RedisNext.js (Turbopack)0.037s (-9.0% 🟢)1.019s (~)0.983s101.21x
🌐 StarterNext.js (Turbopack)0.040s (+16.1% 🔺)1.015s (~)0.975s101.31x
💻 LocalNext.js (Turbopack)0.041s (+1.5%)1.016s (~)0.975s101.36x
💻 LocalExpress0.044s (-1.6%)1.008s (~)0.964s101.45x
🐘 PostgresNext.js (Turbopack)0.123s (-46.7% 🟢)1.018s (~)0.895s104.06x
🌐 MongoDBNext.js (Turbopack)0.129s (+99.4% 🔺)1.016s (~)0.888s104.24x
🐘 PostgresNitro0.248s (+27.6% 🔺)1.023s (-0.8%)0.775s108.20x
🐘 PostgresExpress0.378s (+32.5% 🔺)1.012s (~)0.634s1012.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.602s (+20.6% 🔺)1.592s (+11.9% 🔺)0.991s101.00x
▲ VercelExpress0.642s (+38.4% 🔺)1.517s (+8.8% 🔺)0.875s101.07x
▲ VercelNext.js (Turbopack)0.745s (+12.9% 🔺)1.695s (+0.6%)0.950s101.24x

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.076s (-32.0% 🟢)1.006s (~)0.930s101.00x
🌐 RedisNext.js (Turbopack)0.078s (-20.9% 🟢)1.013s (~)0.935s101.03x
🌐 StarterNext.js (Turbopack)0.081s (+2.1%)1.011s (~)0.930s101.07x
💻 LocalNext.js (Turbopack)0.086s (-6.3% 🟢)1.010s (~)0.924s101.14x
💻 LocalExpress0.113s (~)1.006s (~)0.894s101.49x
🌐 MongoDBNext.js (Turbopack)0.312s (-1.1%)1.012s (~)0.699s104.13x
🐘 PostgresNext.js (Turbopack)0.942s (+8.7% 🔺)1.115s (+10.0% 🔺)0.173s1012.44x
🐘 PostgresNitro1.131s (-22.9% 🟢)2.012s (~)0.881s1014.94x
🐘 PostgresExpress1.251s (+9.0% 🔺)2.009s (~)0.759s1016.52x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.522s (+8.6% 🔺)2.603s (+8.1% 🔺)1.081s101.00x
▲ VercelExpress1.535s (+8.2% 🔺)2.462s (+3.6%)0.927s101.01x
▲ VercelNitro1.599s (+20.5% 🔺)2.599s (+7.8% 🔺)1.000s101.05x

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.506s (-34.7% 🟢)1.005s (~)0.499s51.00x
🌐 RedisNext.js (Turbopack)0.514s (-16.2% 🟢)1.012s (~)0.499s51.02x
🌐 StarterNext.js (Turbopack)0.580s (~)1.010s (~)0.429s51.15x
💻 LocalNext.js (Turbopack)0.613s (+0.6%)1.009s (~)0.396s51.21x
💻 LocalExpress0.771s (-0.8%)1.006s (~)0.235s51.52x
🌐 MongoDBNext.js (Turbopack)2.129s (-1.4%)3.013s (~)0.884s54.21x
🐘 PostgresNext.js (Turbopack)5.013s (-4.5%)5.216s (-13.4% 🟢)0.203s59.91x
🐘 PostgresNitro8.253s (+54.4% 🔺)8.617s (+43.2% 🔺)0.364s516.32x
🐘 PostgresExpress9.256s (-11.2% 🟢)10.018s (-9.1% 🟢)0.762s518.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro10.274s (-38.3% 🟢)10.904s (-36.0% 🟢)0.630s51.00x
▲ VercelNext.js (Turbopack)10.365s (+6.9% 🔺)11.236s (+8.0% 🔺)0.871s51.01x
▲ VercelExpress10.740s (+6.7% 🔺)11.328s (+7.3% 🔺)0.588s51.05x

workflow with 10 parallel steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.335s (-15.5% 🟢)1.005s (~)0.671s51.00x
🌐 StarterNext.js (Turbopack)0.365s (+2.2%)1.008s (~)0.644s51.09x
💻 LocalNext.js (Turbopack)0.372s (-9.6% 🟢)1.009s (~)0.637s51.11x
🌐 RedisNext.js (Turbopack)0.379s (+6.5% 🔺)1.011s (~)0.632s51.13x
💻 LocalExpress0.419s (-1.3%)1.006s (~)0.588s51.25x
🐘 PostgresNext.js (Turbopack)0.750s (-9.2% 🟢)1.013s (-16.5% 🟢)0.263s52.24x
🐘 PostgresExpress1.106s (-32.4% 🟢)2.013s (~)0.907s53.31x
🐘 PostgresNitro1.164s (+23.4% 🔺)1.618s (+14.8% 🔺)0.454s53.48x
🌐 MongoDBNext.js (Turbopack)1.592s (+1.1%)2.009s (~)0.417s54.76x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.734s (+9.7% 🔺)3.469s (+1.7%)0.734s51.00x
▲ VercelNitro2.923s (+7.7% 🔺)3.679s (+4.0%)0.756s51.07x
▲ VercelNext.js (Turbopack)2.968s (+17.0% 🔺)3.737s (+9.1% 🔺)0.769s51.09x

stress test: Promise.all with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.783s2.036s0.253s151.00x
🌐 RedisNext.js (Turbopack)3.758s4.073s0.315s82.11x
🐘 PostgresNext.js (Turbopack)8.075s8.403s0.328s44.53x
💻 LocalNitro8.217s8.505s0.288s44.61x
🐘 PostgresExpress8.232s8.666s0.434s44.62x
🐘 PostgresNitro8.365s8.860s0.495s44.69x
💻 LocalNext.js (Turbopack)10.060s10.339s0.279s35.64x
💻 LocalExpress11.128s11.607s0.480s36.24x
🌐 MongoDBNext.js (Turbopack)19.788s20.566s0.778s211.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.898s18.865s0.967s21.00x
▲ VercelNitro21.856s22.435s0.579s21.22x
▲ VercelNext.js (Turbopack)23.483s24.076s0.594s21.31x

stress test: Promise.race with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)2.029s2.094s0.065s151.00x
🌐 RedisNext.js (Turbopack)3.906s4.362s0.456s71.93x
🐘 PostgresNext.js (Turbopack)8.845s9.083s0.237s44.36x
🐘 PostgresNitro9.212s9.497s0.285s44.54x
🐘 PostgresExpress9.417s9.854s0.437s44.64x
💻 LocalExpress9.762s10.286s0.524s44.81x
💻 LocalNitro10.275s10.653s0.378s35.06x
💻 LocalNext.js (Turbopack)11.230s11.739s0.509s35.54x
🌐 MongoDBNext.js (Turbopack)20.093s20.520s0.427s29.90x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.370s16.098s0.728s21.00x
▲ VercelNitro15.832s16.430s0.598s21.03x
▲ VercelExpress16.401s16.779s0.377s21.07x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.114s (-37.0% 🟢)0.998s (+0.7%)1.008s (~)0.894s101.00x
🌐 RedisNext.js (Turbopack)0.115s (-19.8% 🟢)1.003s (~)1.011s (~)0.896s101.02x
🌐 StarterNext.js (Turbopack)0.127s (-3.5%)1.004s (~)1.008s (~)0.881s101.12x
💻 LocalNext.js (Turbopack)0.138s (-3.8%)1.002s (~)1.013s (~)0.875s101.22x
💻 LocalExpress0.179s (-1.3%)0.992s (~)1.009s (~)0.830s101.58x
🌐 MongoDBNext.js (Turbopack)0.466s (-2.5%)0.978s (+0.8%)1.011s (~)0.545s104.10x
🐘 PostgresNext.js (Turbopack)0.662s (-20.4% 🟢)0.956s (-30.1% 🟢)1.012s (-28.4% 🟢)0.350s105.84x
🐘 PostgresNitro1.206s (+3.9%)1.833s (-2.4%)2.011s (~)0.805s1010.63x
🐘 PostgresExpress1.453s (-31.0% 🟢)1.587s (-34.8% 🟢)2.011s (-25.9% 🟢)0.558s1012.80x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.424s (+7.5% 🔺)2.842s (+13.3% 🔺)3.254s (+13.9% 🔺)0.830s101.00x
▲ VercelNext.js (Turbopack)2.555s (+9.7% 🔺)2.982s (+25.6% 🔺)3.420s (+22.7% 🔺)0.865s101.05x
▲ VercelNitro2.558s (+11.2% 🔺)3.024s (+13.1% 🔺)3.467s (+11.4% 🔺)0.909s101.06x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro6/7
🐘 PostgresNext.js (Turbopack)7/7
▲ VercelExpress3/7

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/7
Next.js (Turbopack)🌐 Redis4/7
Nitro💻 Local6/7
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)
  • 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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

@github-actions

github-actionsBot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
⚠️ ▲ Vercel Production250010260
✅ 🪟 Windows260026
❌ 🌍 Community Worlds82340116
❌ 📋 Other241126
Total3823511428

❌ Failed Tests

mongodb (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 202 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:255:24
at processTicksAndRejections (node:internal/process/tas
redis (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 200 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:285:25
at processTicksAndRejections (node:internal/process/tas
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(3) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'failed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:647:30
at processTicksAndRejections (node:internal/
starter (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:725:31
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:748:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:784:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:835:36
at processTicksAndRejections (node:intern
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pack
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F98_duplicate_case.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/wo
turso (🌍 Community Worlds): e2e should work with react rendering in step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F8_react_render.tsx&workflowFn=reactWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e promiseAllWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAllWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e promiseRaceWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow
turso (🌍 Community Worlds): e2e promiseAnyWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAnyWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e readableStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=readableStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packag
turso (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=webhookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pac
turso (🌍 Community Worlds): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=sleepingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e nullByteWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=nullByteWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e workflowAndStepMetadataWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=workflowAndStepMetadataWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e outputStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflo
turso (🌍 Community Worlds): e2e outputStreamInsideStepWorkflow - getWritable() called inside step functions

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamInsideStepWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e fetchWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=fetchWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packa
turso (🌍 Community Worlds): e2e promiseRaceStressTestWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceStressTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
turso (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryAttemptCounterWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e retryableAndFatalErrorWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryableAndFatalErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=crossFileErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookCleanupTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionPassingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionWithClosureWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e closureVariableWorkflow - nested step functions with closure variables

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=closureVariableWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=spawnWorkflowFromStepWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
e2e-vercel-prod-fastify (📋 Other): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: STACK_TRACE_ERROR
at task (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:638:27)
at Object.<anonymou

Details by Category

⚠️ ▲ Vercel Production
AppPassedFailedSkipped
⚠️ astro2501
⚠️ example2501
⚠️ express2501
⚠️ hono2501
⚠️ nextjs-turbopack2501
⚠️ nextjs-webpack2501
⚠️ nitro2501
⚠️ nuxt2501
⚠️ sveltekit2501
⚠️ vite2501
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack2600
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb2510
✅ redis-dev300
❌ redis2510
✅ starter-dev300
❌ starter1880
✅ turso-dev300
❌ turso2240
❌ 📋 Other
AppPassedFailedSkipped
❌ e2e-vercel-prod-fastify2411

⚠️Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygpGraphite App

pranaygp commented Dec 5, 2025

Copy link
Copy Markdown
ContributorAuthor

CopilotAI 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.

Pull request overview

This PR adds stress test benchmarks to reproduce and measure performance issues with Promise.race and Promise.all when handling hundreds to thousands of concurrent steps. The benchmarks test workflow execution at 100, 500, and 1000 concurrent step scales.

  • Adds two new stress test workflow functions to isolate concurrent step tracking overhead
  • Introduces six new benchmark tests (3 for Promise.all, 3 for Promise.race) at different scales
  • Uses longer timeout durations and fewer iterations for larger tests to accommodate potential performance degradation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
workbench/example/workflows/97_bench.tsAdds stressTestStep, promiseAllStressTestWorkflow, and promiseRaceStressTestLargeWorkflow to test concurrent step handling at scale
packages/core/e2e/bench.bench.tsAdds 6 new benchmark tests for Promise.all and Promise.race patterns with 100/500/1000 concurrent steps, using appropriate timeout and iteration configurations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +121 to +123
const result = await Promise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);

CopilotAIDec 5, 2025

Copy link

Choose a reason for hiding this comment

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

The Promise.race pattern has a logical bug. The Map is keyed by index i, but runningTasks.delete(result) attempts to delete using the result value (which equals i since stressTestStep(i) returns i). While this happens to work when result equals the key, it creates a tight coupling and will fail if the step returns any value different from its input.

Additionally, this doesn't correctly track which promise completed. Since multiple tasks can have the same result value, deleting by result could remove the wrong task or fail to remove any task if the result doesn't match a key.

Consider using Promise.race with an array of objects that include both the promise and its key:

construnningTasks=newMap<number,Promise<number>>();for(leti=0;i<count;i++){runningTasks.set(i,stressTestStep(i));}constdone: number[]=[];while(runningTasks.size>0){constentries=Array.from(runningTasks.entries());constracePromises=entries.map(([key,promise])=>promise.then(result=>({ key, result })));const{ key, result }=awaitPromise.race(racePromises);done.push(result);runningTasks.delete(key);}
Suggested change
constresult=awaitPromise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);
constentries=Array.from(runningTasks.entries());
constracePromises=entries.map(([key,promise])=>
promise.then(result=>({ key, result }))
);
const{ key, result }=awaitPromise.race(racePromises);
done.push(result);
runningTasks.delete(key);

Copilot uses AI. Check for mistakes.
pranaygpand others added 5 commits December 4, 2025 22:13
Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.
New workflows:
- promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
- promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern
New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add in-memory cache for file existence checks to avoid expensive fs.access() calls
- Increase default concurrency limit from 20 to 100
- Improve HTTP connection pooling (100 connections, 30s keep-alive)
These optimizations significantly improve performance when running workflows
with many concurrent steps (100+).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Skip warmup iterations and run only 1 sample for stress tests
to reduce CI time while still catching the reported issue.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Temporarily skip the high-concurrency benchmarks (500/1000 steps) to
avoid CI issues while we implement performance optimizations.
See beads issue wrk-fyx for the optimization plan.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
{ time: 60000, iterations: 1, warmupIterations: 0, teardown }
);

// TODO: Re-enable after performance optimizations (see beads issue wrk-fyx)

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.

Should we also be stress testing for Promise.allSettled?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Can add more in a future PR but should be no different than Promise.all where everything succeeds

Will need to add a new step that throws errors too, to stress test retrying steps that fail

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I'm gonna make sure these tests are performant with the incoming PRs, and make sure they don't break (hence why I disabled 500 and 1k) and then will add more teats

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.

4 participants

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

Add stress test benchmarks for large concurrent step counts - #539

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts
Dec 5, 2025
Merged

Add stress test benchmarks for large concurrent step counts#539
pranaygp merged 5 commits into
mainfrom
pranaygp/12-04-add_stress_test_benchmarks_for_large_concurrent_step_counts

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.

New workflows:

  • promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
  • promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern

New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

CopilotAI review requested due to automatic review settings December 5, 2025 00:25
@changeset-bot

changeset-botBot commented Dec 5, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9487c93

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

This PR includes changesets to release 14 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@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 Dec 5, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 5, 2025

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🥇 Nitro0.030s (-31.6% 🟢)1.007s (~)0.976s101.00x
🌐 RedisNext.js (Turbopack)0.037s (-9.0% 🟢)1.019s (~)0.983s101.21x
🌐 StarterNext.js (Turbopack)0.040s (+16.1% 🔺)1.015s (~)0.975s101.31x
💻 LocalNext.js (Turbopack)0.041s (+1.5%)1.016s (~)0.975s101.36x
💻 LocalExpress0.044s (-1.6%)1.008s (~)0.964s101.45x
🐘 PostgresNext.js (Turbopack)0.123s (-46.7% 🟢)1.018s (~)0.895s104.06x
🌐 MongoDBNext.js (Turbopack)0.129s (+99.4% 🔺)1.016s (~)0.888s104.24x
🐘 PostgresNitro0.248s (+27.6% 🔺)1.023s (-0.8%)0.775s108.20x
🐘 PostgresExpress0.378s (+32.5% 🔺)1.012s (~)0.634s1012.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.602s (+20.6% 🔺)1.592s (+11.9% 🔺)0.991s101.00x
▲ VercelExpress0.642s (+38.4% 🔺)1.517s (+8.8% 🔺)0.875s101.07x
▲ VercelNext.js (Turbopack)0.745s (+12.9% 🔺)1.695s (+0.6%)0.950s101.24x

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.076s (-32.0% 🟢)1.006s (~)0.930s101.00x
🌐 RedisNext.js (Turbopack)0.078s (-20.9% 🟢)1.013s (~)0.935s101.03x
🌐 StarterNext.js (Turbopack)0.081s (+2.1%)1.011s (~)0.930s101.07x
💻 LocalNext.js (Turbopack)0.086s (-6.3% 🟢)1.010s (~)0.924s101.14x
💻 LocalExpress0.113s (~)1.006s (~)0.894s101.49x
🌐 MongoDBNext.js (Turbopack)0.312s (-1.1%)1.012s (~)0.699s104.13x
🐘 PostgresNext.js (Turbopack)0.942s (+8.7% 🔺)1.115s (+10.0% 🔺)0.173s1012.44x
🐘 PostgresNitro1.131s (-22.9% 🟢)2.012s (~)0.881s1014.94x
🐘 PostgresExpress1.251s (+9.0% 🔺)2.009s (~)0.759s1016.52x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.522s (+8.6% 🔺)2.603s (+8.1% 🔺)1.081s101.00x
▲ VercelExpress1.535s (+8.2% 🔺)2.462s (+3.6%)0.927s101.01x
▲ VercelNitro1.599s (+20.5% 🔺)2.599s (+7.8% 🔺)1.000s101.05x

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.506s (-34.7% 🟢)1.005s (~)0.499s51.00x
🌐 RedisNext.js (Turbopack)0.514s (-16.2% 🟢)1.012s (~)0.499s51.02x
🌐 StarterNext.js (Turbopack)0.580s (~)1.010s (~)0.429s51.15x
💻 LocalNext.js (Turbopack)0.613s (+0.6%)1.009s (~)0.396s51.21x
💻 LocalExpress0.771s (-0.8%)1.006s (~)0.235s51.52x
🌐 MongoDBNext.js (Turbopack)2.129s (-1.4%)3.013s (~)0.884s54.21x
🐘 PostgresNext.js (Turbopack)5.013s (-4.5%)5.216s (-13.4% 🟢)0.203s59.91x
🐘 PostgresNitro8.253s (+54.4% 🔺)8.617s (+43.2% 🔺)0.364s516.32x
🐘 PostgresExpress9.256s (-11.2% 🟢)10.018s (-9.1% 🟢)0.762s518.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro10.274s (-38.3% 🟢)10.904s (-36.0% 🟢)0.630s51.00x
▲ VercelNext.js (Turbopack)10.365s (+6.9% 🔺)11.236s (+8.0% 🔺)0.871s51.01x
▲ VercelExpress10.740s (+6.7% 🔺)11.328s (+7.3% 🔺)0.588s51.05x

workflow with 10 parallel steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.335s (-15.5% 🟢)1.005s (~)0.671s51.00x
🌐 StarterNext.js (Turbopack)0.365s (+2.2%)1.008s (~)0.644s51.09x
💻 LocalNext.js (Turbopack)0.372s (-9.6% 🟢)1.009s (~)0.637s51.11x
🌐 RedisNext.js (Turbopack)0.379s (+6.5% 🔺)1.011s (~)0.632s51.13x
💻 LocalExpress0.419s (-1.3%)1.006s (~)0.588s51.25x
🐘 PostgresNext.js (Turbopack)0.750s (-9.2% 🟢)1.013s (-16.5% 🟢)0.263s52.24x
🐘 PostgresExpress1.106s (-32.4% 🟢)2.013s (~)0.907s53.31x
🐘 PostgresNitro1.164s (+23.4% 🔺)1.618s (+14.8% 🔺)0.454s53.48x
🌐 MongoDBNext.js (Turbopack)1.592s (+1.1%)2.009s (~)0.417s54.76x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.734s (+9.7% 🔺)3.469s (+1.7%)0.734s51.00x
▲ VercelNitro2.923s (+7.7% 🔺)3.679s (+4.0%)0.756s51.07x
▲ VercelNext.js (Turbopack)2.968s (+17.0% 🔺)3.737s (+9.1% 🔺)0.769s51.09x

stress test: Promise.all with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.783s2.036s0.253s151.00x
🌐 RedisNext.js (Turbopack)3.758s4.073s0.315s82.11x
🐘 PostgresNext.js (Turbopack)8.075s8.403s0.328s44.53x
💻 LocalNitro8.217s8.505s0.288s44.61x
🐘 PostgresExpress8.232s8.666s0.434s44.62x
🐘 PostgresNitro8.365s8.860s0.495s44.69x
💻 LocalNext.js (Turbopack)10.060s10.339s0.279s35.64x
💻 LocalExpress11.128s11.607s0.480s36.24x
🌐 MongoDBNext.js (Turbopack)19.788s20.566s0.778s211.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.898s18.865s0.967s21.00x
▲ VercelNitro21.856s22.435s0.579s21.22x
▲ VercelNext.js (Turbopack)23.483s24.076s0.594s21.31x

stress test: Promise.race with 100 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)2.029s2.094s0.065s151.00x
🌐 RedisNext.js (Turbopack)3.906s4.362s0.456s71.93x
🐘 PostgresNext.js (Turbopack)8.845s9.083s0.237s44.36x
🐘 PostgresNitro9.212s9.497s0.285s44.54x
🐘 PostgresExpress9.417s9.854s0.437s44.64x
💻 LocalExpress9.762s10.286s0.524s44.81x
💻 LocalNitro10.275s10.653s0.378s35.06x
💻 LocalNext.js (Turbopack)11.230s11.739s0.509s35.54x
🌐 MongoDBNext.js (Turbopack)20.093s20.520s0.427s29.90x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.370s16.098s0.728s21.00x
▲ VercelNitro15.832s16.430s0.598s21.03x
▲ VercelExpress16.401s16.779s0.377s21.07x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.114s (-37.0% 🟢)0.998s (+0.7%)1.008s (~)0.894s101.00x
🌐 RedisNext.js (Turbopack)0.115s (-19.8% 🟢)1.003s (~)1.011s (~)0.896s101.02x
🌐 StarterNext.js (Turbopack)0.127s (-3.5%)1.004s (~)1.008s (~)0.881s101.12x
💻 LocalNext.js (Turbopack)0.138s (-3.8%)1.002s (~)1.013s (~)0.875s101.22x
💻 LocalExpress0.179s (-1.3%)0.992s (~)1.009s (~)0.830s101.58x
🌐 MongoDBNext.js (Turbopack)0.466s (-2.5%)0.978s (+0.8%)1.011s (~)0.545s104.10x
🐘 PostgresNext.js (Turbopack)0.662s (-20.4% 🟢)0.956s (-30.1% 🟢)1.012s (-28.4% 🟢)0.350s105.84x
🐘 PostgresNitro1.206s (+3.9%)1.833s (-2.4%)2.011s (~)0.805s1010.63x
🐘 PostgresExpress1.453s (-31.0% 🟢)1.587s (-34.8% 🟢)2.011s (-25.9% 🟢)0.558s1012.80x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.424s (+7.5% 🔺)2.842s (+13.3% 🔺)3.254s (+13.9% 🔺)0.830s101.00x
▲ VercelNext.js (Turbopack)2.555s (+9.7% 🔺)2.982s (+25.6% 🔺)3.420s (+22.7% 🔺)0.865s101.05x
▲ VercelNitro2.558s (+11.2% 🔺)3.024s (+13.1% 🔺)3.467s (+11.4% 🔺)0.909s101.06x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro6/7
🐘 PostgresNext.js (Turbopack)7/7
▲ VercelExpress3/7

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/7
Next.js (Turbopack)🌐 Redis4/7
Nitro💻 Local6/7
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)
  • 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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

@github-actions

github-actionsBot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
⚠️ ▲ Vercel Production250010260
✅ 🪟 Windows260026
❌ 🌍 Community Worlds82340116
❌ 📋 Other241126
Total3823511428

❌ Failed Tests

mongodb (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 202 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:255:24
at processTicksAndRejections (node:internal/process/tas
redis (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected 404 to be 200 // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:285:25
at processTicksAndRejections (node:internal/process/tas
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(5) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected {} to match object { …(3) }
at Proxy.<anonymous> (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+expect@3.2.4/node_modules/@vitest/expect/dist/index
starter (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'failed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:647:30
at processTicksAndRejections (node:internal/
starter (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:725:31
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:748:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:784:30
at processTicksAndRejections (node:intern
starter (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

AssertionError: expected undefined to be 'completed' // Object.is equality
at /home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts:835:36
at processTicksAndRejections (node:intern
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pack
turso (🌍 Community Worlds): e2e addTenWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F98_duplicate_case.ts&workflowFn=addTenWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/wo
turso (🌍 Community Worlds): e2e should work with react rendering in step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F8_react_render.tsx&workflowFn=reactWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e promiseAllWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAllWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e promiseRaceWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow
turso (🌍 Community Worlds): e2e promiseAnyWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseAnyWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/
turso (🌍 Community Worlds): e2e readableStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=readableStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packag
turso (🌍 Community Worlds): e2e webhookWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=webhookWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pac
turso (🌍 Community Worlds): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=sleepingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e nullByteWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=nullByteWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/pa
turso (🌍 Community Worlds): e2e workflowAndStepMetadataWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=workflowAndStepMetadataWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e outputStreamWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflo
turso (🌍 Community Worlds): e2e outputStreamInsideStepWorkflow - getWritable() called inside step functions

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=outputStreamInsideStepWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e fetchWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=fetchWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workflow/packa
turso (🌍 Community Worlds): e2e promiseRaceStressTestWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=promiseRaceStressTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
turso (🌍 Community Worlds): e2e retryAttemptCounterWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryAttemptCounterWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e retryableAndFatalErrorWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=retryableAndFatalErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workfl
turso (🌍 Community Worlds): e2e crossFileErrorWorkflow - stack traces work across imported modules

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=crossFileErrorWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/workf
turso (🌍 Community Worlds): e2e hookCleanupTestWorkflow - hook token reuse after workflow completion

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=hookCleanupTestWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionPassingWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/
turso (🌍 Community Worlds): e2e stepFunctionWithClosureWorkflow - step function with closure variables passed as argument

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=stepFunctionWithClosureWorkflow 500: at triggerWorkflow (/home/runner/work/workf
turso (🌍 Community Worlds): e2e closureVariableWorkflow - nested step functions with closure variables

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=closureVariableWorkflow 500: at triggerWorkflow (/home/runner/work/workflow/work
turso (🌍 Community Worlds): e2e spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: Failed to trigger workflow: http://localhost:3000/api/trigger?workflowFile=workflows%2F99_e2e.ts&workflowFn=spawnWorkflowFromStepWorkflow 500: at triggerWorkflow (/home/runner/work/workflo
e2e-vercel-prod-fastify (📋 Other): e2e sleepingWorkflow

File:/home/runner/work/workflow/workflow/packages/core/e2e/e2e.test.ts

Error: STACK_TRACE_ERROR
at task (file:///home/runner/work/workflow/workflow/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:638:27)
at Object.<anonymou

Details by Category

⚠️ ▲ Vercel Production
AppPassedFailedSkipped
⚠️ astro2501
⚠️ example2501
⚠️ express2501
⚠️ hono2501
⚠️ nextjs-turbopack2501
⚠️ nextjs-webpack2501
⚠️ nitro2501
⚠️ nuxt2501
⚠️ sveltekit2501
⚠️ vite2501
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack2600
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb2510
✅ redis-dev300
❌ redis2510
✅ starter-dev300
❌ starter1880
✅ turso-dev300
❌ turso2240
❌ 📋 Other
AppPassedFailedSkipped
❌ e2e-vercel-prod-fastify2411

⚠️Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygpGraphite App

pranaygp commented Dec 5, 2025

Copy link
Copy Markdown
ContributorAuthor

CopilotAI 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.

Pull request overview

This PR adds stress test benchmarks to reproduce and measure performance issues with Promise.race and Promise.all when handling hundreds to thousands of concurrent steps. The benchmarks test workflow execution at 100, 500, and 1000 concurrent step scales.

  • Adds two new stress test workflow functions to isolate concurrent step tracking overhead
  • Introduces six new benchmark tests (3 for Promise.all, 3 for Promise.race) at different scales
  • Uses longer timeout durations and fewer iterations for larger tests to accommodate potential performance degradation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
workbench/example/workflows/97_bench.tsAdds stressTestStep, promiseAllStressTestWorkflow, and promiseRaceStressTestLargeWorkflow to test concurrent step handling at scale
packages/core/e2e/bench.bench.tsAdds 6 new benchmark tests for Promise.all and Promise.race patterns with 100/500/1000 concurrent steps, using appropriate timeout and iteration configurations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +121 to +123
const result = await Promise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);

CopilotAIDec 5, 2025

Copy link

Choose a reason for hiding this comment

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

The Promise.race pattern has a logical bug. The Map is keyed by index i, but runningTasks.delete(result) attempts to delete using the result value (which equals i since stressTestStep(i) returns i). While this happens to work when result equals the key, it creates a tight coupling and will fail if the step returns any value different from its input.

Additionally, this doesn't correctly track which promise completed. Since multiple tasks can have the same result value, deleting by result could remove the wrong task or fail to remove any task if the result doesn't match a key.

Consider using Promise.race with an array of objects that include both the promise and its key:

construnningTasks=newMap<number,Promise<number>>();for(leti=0;i<count;i++){runningTasks.set(i,stressTestStep(i));}constdone: number[]=[];while(runningTasks.size>0){constentries=Array.from(runningTasks.entries());constracePromises=entries.map(([key,promise])=>promise.then(result=>({ key, result })));const{ key, result }=awaitPromise.race(racePromises);done.push(result);runningTasks.delete(key);}
Suggested change
constresult=awaitPromise.race(runningTasks.values());
done.push(result);
runningTasks.delete(result);
constentries=Array.from(runningTasks.entries());
constracePromises=entries.map(([key,promise])=>
promise.then(result=>({ key, result }))
);
const{ key, result }=awaitPromise.race(racePromises);
done.push(result);
runningTasks.delete(key);

Copilot uses AI. Check for mistakes.
pranaygpand others added 5 commits December 4, 2025 22:13
Add new benchmark workflows to reproduce reported issues with Promise.race
and Promise.all falling over when array sizes exceed a few hundred.
New workflows:
- promiseAllStressTestWorkflow(count) - Tests Promise.all with many concurrent steps
- promiseRaceStressTestLargeWorkflow(count) - Tests Promise.race with Map pattern
New benchmarks at 100, 500, and 1000 concurrent step scales for both
Promise.all and Promise.race patterns.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add in-memory cache for file existence checks to avoid expensive fs.access() calls
- Increase default concurrency limit from 20 to 100
- Improve HTTP connection pooling (100 connections, 30s keep-alive)
These optimizations significantly improve performance when running workflows
with many concurrent steps (100+).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Skip warmup iterations and run only 1 sample for stress tests
to reduce CI time while still catching the reported issue.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Temporarily skip the high-concurrency benchmarks (500/1000 steps) to
avoid CI issues while we implement performance optimizations.
See beads issue wrk-fyx for the optimization plan.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
{ time: 60000, iterations: 1, warmupIterations: 0, teardown }
);

// TODO: Re-enable after performance optimizations (see beads issue wrk-fyx)

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.

Should we also be stress testing for Promise.allSettled?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Can add more in a future PR but should be no different than Promise.all where everything succeeds

Will need to add a new step that throws errors too, to stress test retrying steps that fail

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I'm gonna make sure these tests are performant with the incoming PRs, and make sure they don't break (hence why I disabled 500 and 1k) and then will add more teats

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.

4 participants

@pranaygp@VaguelySerious@karthikscale3