Benchmarks
Performance comparison: tsz vs tsgo
Benchmarks are run using hyperfine with warmup passes and multiple runs. Each benchmark measures wall-clock time for a full type-check pass (no emit).
tsz is compiled with --profile dist (LTO enabled, single codegen unit). tsgo is the native Go compiler from the TypeScript team.
tsz (Rust)
tsgo (Go)
conditionalTypeDiscriminatingLargeUnionRegularTypeFetchingSpeedReasonable.ts
manyConstExports.ts
binderBinaryExpressionStress.ts
binderBinaryExpressionStressJs.ts
enumLiteralsSubtypeReduction.ts
binaryArithmeticControlFlowGraphNotTooLarge.ts
privacyFunctionParameterDeclFile.ts
privacyGloFunc.ts
privacyTypeParameterOfFunctionDeclFile.ts
typedArrays.ts
controlFlowArrays.ts
utility-types/index.ts
utility-types/utility-types.ts
utility-types/mapped-types.ts
utility-types/aliases-and-guards.ts
ts-toolbelt/Iteration/Iteration.ts
ts-toolbelt/Misc/BuiltIn.ts
ts-toolbelt/Object/Invert.ts
ts-toolbelt/Any/Compute.ts
ts-essentials/xor.ts
ts-essentials/paths.ts
ts-essentials/deep-pick.ts
ts-essentials/deep-readonly.ts
10 classes
50 classes
100 classes
200 classes
20 generic functions
50 generic functions
100 generic functions
200 generic functions
DeepPartial optional-chain N=400
Shallow optional-chain N=400
50 union members
100 union members
200 union members
Recursive generic depth=20
Recursive generic depth=35
Recursive generic depth=45
Conditional dist N=50
Conditional dist N=80
Conditional dist N=95
Mapped type keys=100
Mapped type keys=300
Mapped type keys=450
Template literal N=20
Template literal N=35
Template literal N=45
Deep subtype depth=30
Deep subtype depth=60
Deep subtype depth=90
Intersection N=20
Intersection N=35
Intersection N=45
Infer stress N=15
Infer stress N=25
Infer stress N=30
CFA branches=50
CFA branches=100
CFA branches=150
BCT candidates=25
BCT candidates=50
BCT candidates=100
BCT candidates=200
Constraint conflicts N=20
Constraint conflicts N=50
Constraint conflicts N=100
Constraint conflicts N=200
Mapped complex template keys=25
Mapped complex template keys=50
Mapped complex template keys=100
Mapped complex template keys=200
Running Benchmarks Locally
To generate benchmark data yourself:
./scripts/bench-vs-tsgo.sh --json
This produces a JSON file in artifacts/ that the website build script uses to generate charts. Use --quick for faster results with fewer iterations.
See bench-vs-tsgo.sh for full usage.