TypeScript Performance Lab

Each experiment ships its code, the exact command that produced the numbers, and the raw results with the machine they ran on.

Lab #001Confirmed

Typed events

−57%check time with TypeScript 7 after the fix

Yes. Inferring the event name from the generic parameter cut check time by about 40% with TypeScript 6 and by about 65% with TypeScript 7, with the same type safety. Narrowing include to src also stopped TypeScript from reading a generated file the app never imports.

Read the experiment
Before the fixAfter the fixMedian check time, lower is faster

Opened October 2026. Latest run: Apple M3 Pro, 12 cores, 36 GB, Node.js 22.23.3, Nov 9, 2026. 2 machines in total.

Lab #002Open question

TypeScript 6 vs 7 on type-fest

3.5×faster check of type-fest sources, TypeScript 7 vs 6

On an Apple M3 Pro (12 cores), TypeScript 7.0.2 checked the type-fest sources 3.5× faster than TypeScript 6.0.3 (0.484 s vs 1.67 s): 2.6× comes from the native compiler alone (single-threaded) and 1.3× from parallel checking. On the full suite with type tests, TypeScript 6 stops at Node.js's default heap limit (4.0 GiB); with a 16 GiB heap it finishes in 74.6 s, against 14.1 s for TypeScript 7 (5.3× faster), but TypeScript 7 peaks higher in memory (11.6 GiB RSS vs 10.4 GiB). Stays open until a second machine is measured with the same protocol.

Read the experiment
TypeScript 6TypeScript 7Median check time, lower is faster

Latest run: Apple M3 Pro, 12 cores, 36 GB, Node.js 22.23.3, Nov 11, 2026. 2 machines in total.

Method

Same protocol, every experiment

Six rules that make a number worth publishing. The lab repository has the scripts.

  1. Rule 1

    Pin everything

    Compiler versions, external commits and machine context are recorded with every result.

  2. Rule 2

    Measure the same way

    Three runs of tsc with extended diagnostics per condition, median reported with the range.

  3. Rule 3

    Change one thing

    A fix changes a single thing and keeps the same type safety.

  4. Rule 4

    Prove type safety

    A safety file lists usages that must still fail to compile. The run stops if one passes.

  5. Rule 5

    Publish any verdict

    Confirmed, rejected or open. Negative results are published too.

  6. Rule 6

    Know the limits

    Compare conditions on the same machine only. Counters may differ across compilers.