Skip to content

Add TypeScript type performance checks - #12

Merged
SandroMaglione merged 1 commit into
mainfrom
codex/type-performance-checks
Aug 1, 2026
Merged

Add TypeScript type performance checks#12
SandroMaglione merged 1 commit into
mainfrom
codex/type-performance-checks

Conversation

@SandroMaglione

Copy link
Copy Markdown
Member

Summary

  • add isolated Effect-only, import-only, defineStates, make, and handle type-performance fixtures
  • add a dependency-free runner around tsc --extendedDiagnostics that reports total and marginal type instantiations
  • add pnpm perf:types, which builds the package before measuring its public declarations
  • add project guidance requiring before/after type-performance measurements for feature work

Why

Type safety and user-facing inference are core product concerns for effect-machine. These checks make the compiler cost of API changes visible without introducing another benchmarking dependency, while the agent guidance makes performance comparison part of the normal feature workflow.

Current results

Scenario                                  Instantiations  Marginal
Effect only                                           55  baseline
Import effect-machine                                 55        +0
Machine.defineStates (3 states)                    2,883    +2,828
Machine.make (3 states, 2 events)                  7,838    +4,947
machine.handle (3 states, 2 transitions)          17,314    +9,476

Check time remains informational because wall-clock measurements vary; instantiation counts are the stable comparison metric.

Validation

  • pnpm perf:types
  • pnpm typecheck
  • pnpm test:types — 92 tests, 378 assertions
  • Prettier check for all changed files

@SandroMaglione
SandroMaglione marked this pull request as ready for review August 1, 2026 17:45
@SandroMaglione
SandroMaglione merged commit 13af066 into main Aug 1, 2026
2 checks passed
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