Skip to content

Upgrade XState v6 alpha - #96

Merged
SandroMaglione merged 1 commit into
mainfrom
codex/upgrade-xstate-alpha
Aug 12, 2026
Merged

Upgrade XState v6 alpha#96
SandroMaglione merged 1 commit into
mainfrom
codex/upgrade-xstate-alpha

Conversation

@SandroMaglione

@SandroMaglione SandroMaglione commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary

  • upgrade the XState v6 benchmark dependency from 6.0.0-alpha.31 to 6.0.0-alpha.36
  • refresh the pnpm lockfile
  • add the required patch changeset

Changeset

  • Added or updated for a library or package-metadata change
  • Not required because this PR does not change src/ or package.json

Validation

  • pnpm check
  • pnpm perf:types
  • pnpm perf:runtime
  • Relevant example checks, when examples changed (not applicable)
  • Reviewed the automated type-performance report, when the public TypeScript API or inference changed (not applicable)
  • Reviewed the automated runtime-performance report

The local runtime benchmark completed successfully with XState 6.0.0-alpha.36.

The automated base-versus-PR runtime workflow was run twice (five independent processes per revision in each run). Type instantiations were exactly unchanged, heap slopes were effectively flat, and the first run's isolated -3.5% / -3.9% throughput readings did not reproduce (-0.1% / -1.3% on confirmation). The remaining differences were within the reported shared-runner variability.

@github-actions

Copy link
Copy Markdown
Contributor

Type performance

Measured with TypeScript 6.0.3 and skipLibCheck=true.

Scenario Base PR Difference
Effect only 55 55 0 (0.0%)
Import effect-machine 55 55 0 (0.0%)
Machine.defineStates (3 states) 2,965 2,965 0 (0.0%)
Machine.make (3 states, 2 events) 8,715 8,715 0 (0.0%)
machine.handle (3 states, 2 transitions) 23,492 23,492 0 (0.0%)
machine.handle (depth 8) 117,075 117,075 0 (0.0%)
machine.handle (depth 12) 129,713 129,713 0 (0.0%)
machine.handle (depth 16) 145,055 145,055 0 (0.0%)
machine.handle (depth 24) 183,851 183,851 0 (0.0%)
machine.handle (wide depth 16) 214,189 214,189 0 (0.0%)
machine.handle (parallel/history/choice) 132,667 132,667 0 (0.0%)
machine.handle (4 successive calls) 128,674 128,674 0 (0.0%)
machine exact input/output/error/services 110,584 110,584 0 (0.0%)
execution adapter readiness 127,854 127,854 0 (0.0%)

Marginal instantiations are measured against the matching setup without that API call:

Scenario Base PR Difference
Import effect-machine 0 0 0
Machine.defineStates (3 states) 2,910 2,910 0 (0.0%)
Machine.make (3 states, 2 events) 5,742 5,742 0 (0.0%)
machine.handle (3 states, 2 transitions) 14,777 14,777 0 (0.0%)
machine.handle (depth 8) 109,601 109,601 0 (0.0%)
machine.handle (depth 12) 121,039 121,039 0 (0.0%)
machine.handle (depth 16) 135,181 135,181 0 (0.0%)
machine.handle (depth 24) 171,577 171,577 0 (0.0%)
machine.handle (wide depth 16) 202,224 202,224 0 (0.0%)
machine.handle (parallel/history/choice) 114,331 114,331 0 (0.0%)
machine.handle (4 successive calls) 113,703 113,703 0 (0.0%)
machine exact input/output/error/services 100,670 100,670 0 (0.0%)
execution adapter readiness 102,092 102,092 0 (0.0%)
Check times (informational)
Scenario Base PR
Effect only 0.03s 0.03s
Import effect-machine 0.03s 0.03s
Machine.defineStates (3 states) 0.09s 0.10s
Machine.make (3 states, 2 events) 0.15s 0.15s
machine.handle (3 states, 2 transitions) 0.23s 0.21s
machine.handle (depth 8) 0.48s 0.48s
machine.handle (depth 12) 0.55s 0.52s
machine.handle (depth 16) 0.56s 0.56s
machine.handle (depth 24) 0.65s 0.66s
machine.handle (wide depth 16) 0.72s 0.72s
machine.handle (parallel/history/choice) 0.57s 0.62s
machine.handle (4 successive calls) 0.58s 0.54s
machine exact input/output/error/services 0.49s 0.49s
execution adapter readiness 0.54s 0.55s

Type instantiations are the comparison metric. Check time varies with runner load and is informational only.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Runtime performance

Median of 5 independent benchmark processes on AMD EPYC 9V74 80-Core Processor with Node v24.18.0.

Pull request baseline

Scenario Effect Machine XState 5 XState 6 alpha
Plan counter transitions 129,345 transitions/s 138,735 transitions/s 266,222 transitions/s
Drain burst with terminal fence 513,072 increments/s 379,850 increments/s 484,661 increments/s
Drain burst with a change observer 476,311 increments/s 376,726 increments/s 479,495 increments/s
Lookup and send to one child 412,545 increments/s 373,459 increments/s 461,444 increments/s
Start and stop a machine 168,379 machines/s 181,554 machines/s 173,340 machines/s
Start and stop a parent with one child 43,020 families/s 72,727 families/s 53,311 families/s
Plan transitions through a compound state 116,846 transitions/s
Plan transitions through parallel regions 92,922 transitions/s
Drain burst through a compound state 438,024 events/s 335,466 events/s 458,996 events/s
Drain burst through two parallel regions 451,566 events/s 257,664 events/s 409,531 events/s
Drain a compound-state burst with a change observer 449,096 events/s

Effect runtime reference points

Scenario Effect Machine Effect runtime primitives
Start and stop a raw generic process 24,661 processes/s
Start and stop a raw compiled process 71,073 processes/s
Start and interrupt a suspended fiber 162,101 fibers/s
Start and stop a queue worker 118,455 workers/s
Start and stop an actor shell 109,733 actors/s
Start and stop two actor shells 69,152 families/s
Update an owner-only mutable snapshot 312,012,480 updates/s
Update a synchronized snapshot 1,676,409 updates/s
Create, resolve, and await a terminal latch 1,675,648 latches/s
Memory profile Effect Machine XState 5 XState 6 alpha Effect runtime primitives
Idle machine 1.5 KiB 3.8 KiB 1.5 KiB
Raw generic managed process 12.7 KiB
Raw compiled process 2.8 KiB
Two independent idle machines 2.9 KiB 7.3 KiB 2.7 KiB
Idle parent with one child 4.8 KiB 5.5 KiB 3.4 KiB
Parent with observed child registry 9.0 KiB
Parent with observed invoked child snapshots 5.0 KiB
Suspended Effect fiber 0.6 KiB
Effect queue with waiting fiber 2.8 KiB
Effect mailbox actor shell 3.2 KiB
Two Effect actor shells 6.8 KiB

Effect Machine change from base

Metric Base Base variability PR PR variability Difference
Plan counter transitions 129,531 transitions/s 0.6% MAD 129,345 transitions/s 0.9% MAD -0.1%
Drain burst with terminal fence 519,781 increments/s 0.3% MAD 513,072 increments/s 2.2% MAD -1.3%
Drain burst with a change observer 476,202 increments/s 0.8% MAD 476,311 increments/s 3.1% MAD +0.0%
Lookup and send to one child 422,331 increments/s 0.6% MAD 412,545 increments/s 2.4% MAD -2.3%
Start and stop a machine 169,520 machines/s 1.3% MAD 168,379 machines/s 1.0% MAD -0.7%
Start and stop a parent with one child 42,946 families/s 0.3% MAD 43,020 families/s 1.8% MAD +0.2%
Plan transitions through a compound state 117,219 transitions/s 0.7% MAD 116,846 transitions/s 0.9% MAD -0.3%
Plan transitions through parallel regions 92,262 transitions/s 0.7% MAD 92,922 transitions/s 1.0% MAD +0.7%
Drain burst through a compound state 455,936 events/s 8.9% MAD 438,024 events/s 8.3% MAD -3.9%
Drain burst through two parallel regions 450,880 events/s 1.3% MAD 451,566 events/s 3.2% MAD +0.2%
Drain a compound-state burst with a change observer 455,671 events/s 1.1% MAD 449,096 events/s 4.3% MAD -1.4%
Idle machine heap per unit 1.5 KiB 0.1% MAD 1.5 KiB 0.1% MAD -0.1%
Raw generic managed process heap per unit 12.7 KiB 0.0% MAD 12.7 KiB 0.0% MAD -0.0%
Raw compiled process heap per unit 2.8 KiB 0.3% MAD 2.8 KiB 0.2% MAD -0.9%
Two independent idle machines heap per unit 2.9 KiB 0.0% MAD 2.9 KiB 0.0% MAD +0.0%
Idle parent with one child heap per unit 4.8 KiB 0.0% MAD 4.8 KiB 0.0% MAD -0.0%
Parent with observed child registry heap per unit 9.0 KiB 0.0% MAD 9.0 KiB 0.0% MAD +0.0%
Parent with observed invoked child snapshots heap per unit 5.0 KiB 0.2% MAD 5.0 KiB 0.1% MAD -0.2%

Effect runtime reference change from base

Metric Base Base variability PR PR variability Difference
Start and stop a raw generic process 25,070 processes/s 1.6% MAD 24,661 processes/s 1.6% MAD -1.6%
Start and stop a raw compiled process 71,174 processes/s 0.7% MAD 71,073 processes/s 0.5% MAD -0.1%
Start and interrupt a suspended fiber 160,282 fibers/s 0.2% MAD 162,101 fibers/s 1.4% MAD +1.1%
Start and stop a queue worker 117,897 workers/s 0.6% MAD 118,455 workers/s 0.4% MAD +0.5%
Start and stop an actor shell 109,004 actors/s 0.9% MAD 109,733 actors/s 0.9% MAD +0.7%
Start and stop two actor shells 68,719 families/s 0.3% MAD 69,152 families/s 0.7% MAD +0.6%
Update an owner-only mutable snapshot 312,012,480 updates/s 0.0% MAD 312,012,480 updates/s 0.0% MAD 0.0%
Update a synchronized snapshot 1,662,870 updates/s 0.4% MAD 1,676,409 updates/s 1.4% MAD +0.8%
Create, resolve, and await a terminal latch 1,633,277 latches/s 1.0% MAD 1,675,648 latches/s 0.9% MAD +2.6%
Versions and interpretation
  • Effect Machine: 0.5.1
  • XState 5: 5.32.5
  • XState 6 alpha: 6.0.0-alpha.36
  • Effect runtime primitives: 4.0.0-beta.107

Higher throughput is better; lower heap is better. Variability is the median absolute deviation across independent processes, relative to their median. Runtime measurements on shared GitHub-hosted hardware remain informational, so small differences should be confirmed across multiple workflow runs.

@SandroMaglione
SandroMaglione merged commit 449984b into main Aug 12, 2026
10 checks passed
@SandroMaglione
SandroMaglione deleted the codex/upgrade-xstate-alpha branch August 12, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant