Performance Lab/ Experiment #002

TypeScript 6 vs 7 on type-fest

How much faster does TypeScript 7 type-check a real, type-heavy library than TypeScript 6, and how much of the gain comes from the native compiler itself rather than parallel checking? What happens to memory on a heavy workload?

Lab #002Open question3.5×faster check of type-fest sources, TypeScript 7 vs 6Computed from medians, Nov 11, 2026. Verified on TypeScript 6.0.3 and TypeScript 7.0.2.

Verdict

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.

Takeaway

Most of the gain is the native compiler, so expect it even on CI runners with few cores; more checkers help less (0.642 s with 1 checker, 0.377 s with 8). On large type-test suites, check peak memory before switching: TypeScript 7 needed no heap flag but used more memory at its peak.

Note Types and Instantiations differ between TypeScript 6 and 7 on identical code, so never compare these counters across compilers. TypeScript 7's counters also vary slightly from run to run on the full suite, single-threaded included; on the library sources they are identical across runs.

Note Memory is peak resident memory (RSS) from /usr/bin/time -l, field "maximum resident set size", of the largest process: the Node.js process for TypeScript 6, the native compiler for TypeScript 7 (its launcher replaces itself with the native binary). It is not the compiler's own "Memory used" line, which for TypeScript 6 is the V8 heap.

Note Out of memory means Node.js's default heap limit (4.0 GiB here), not the machine's RAM: TypeScript 6 aborted with "Reached heap limit" at 4.2 GiB RSS, and completed with --max-old-space-size=16384.

Note One library (type-fest at one commit), check time only: no emit, watch mode or editor latency.

Note The two machines differ by CPU as well as core count, so compare conditions within a machine; the comparison between machines is indicative only. On the 1-core Intel Xeon, parallel checking gives 1.0× (0.9× to 1.1×) and the native compiler 4.0×.

Note The Intel Xeon results use the earlier protocol: 3 runs, no warm-up, not interleaved, no RSS. The Apple M3 Pro results use a discarded warm-up per condition and interleaved runs, with other applications open (load average 3.0 to 5.0). The full-suite runs stay noisy: up to 6.7% coefficient of variation.

Note Checker counts were measured in a separate series from the default and single-threaded runs; compare them with each other.

Median check time

TypeScript 6TypeScript 7Median check time, lower is faster

Results on Apple M3 Pro

Nov 11, 2026, 8 runs per condition at most, one discarded warm-up each, conditions interleaved. Apple M3 Pro, 12 cores, 36 GB, Node.js 22.23.3, Darwin 25.2.0.

Sources, TypeScript 6.0.31.67 s median
Sources, TypeScript 7.0.2484 ms median
Sources, TypeScript 7.0.2 single-threaded636 ms median
Sources, TypeScript 7.0.2 with 1 checker642 ms median
Sources, TypeScript 7.0.2 with 2 checkers518 ms median
Sources, TypeScript 7.0.2 with 4 checkers475 ms median
Sources, TypeScript 7.0.2 with 8 checkers377 ms median
Full suite with type tests, TypeScript 6.0.3Out of memory at Node.js's default heap limit (4.0 GiB)
Full suite with type tests, TypeScript 7.0.214.10 s median
Full suite with type tests, TypeScript 6.0.3, 16 GB heap74.56 s median
Full suite with type tests, TypeScript 7.0.2 single-threaded23.02 s median

Bar: median check time. Bracket: fastest to slowest run. Bars share one scale within each workload (sources, checker count, full suite), not across workloads.

ConditionCheckTotalPeak RSSTypesInstantiations
Sources, TypeScript 6.0.31.67 s1.87 s557 MiB234,740707,312
Sources, TypeScript 7.0.2484 ms510 ms367 MiB276,225839,577
Sources, TypeScript 7.0.2 single-threaded636 ms675 ms338 MiB259,464815,224
Sources, TypeScript 7.0.2 with 1 checker642 ms667 ms355 MiB259,464815,224
Sources, TypeScript 7.0.2 with 2 checkers518 ms547 ms369 MiB266,340825,383
Sources, TypeScript 7.0.2 with 4 checkers475 ms501 ms376 MiB276,225839,577
Sources, TypeScript 7.0.2 with 8 checkers377 ms403 ms367 MiB288,128856,115
Full suite with type tests, TypeScript 6.0.3Out of memory at Node.js's default heap limit (4.0 GiB)
Full suite with type tests, TypeScript 7.0.214.10 s14.17 s11.6 GiB15,320,722.538,893,721
Full suite with type tests, TypeScript 6.0.3, 16 GB heap74.56 s75.13 s10.4 GiB8,872,83936,421,290
Full suite with type tests, TypeScript 7.0.2 single-threaded23.02 s23.33 s9.6 GiB8,535,79434,156,859

Results on Intel Xeon Processor @ 2.30GHz

Nov 3, 2026, 3 runs per condition. Intel(R) Xeon(R) Processor @ 2.30GHz, 1 core, 4 GB, Node.js 22.22.2, Linux 6.18.44-fc-v230.

Sources, TypeScript 6.0.36.68 s median
Sources, TypeScript 7.0.21.61 s median
Sources, TypeScript 7.0.2 single-threaded1.67 s median
Full suite with type tests, TypeScript 6.0.3Out of memory (cause not recorded)
Full suite with type tests, TypeScript 7.0.2Out of memory (cause not recorded)

Bar: median check time. Bracket: fastest to slowest run. Bars share one scale within each workload (sources, checker count, full suite), not across workloads.

ConditionCheckTotalPeak RSSTypesInstantiations
Sources, TypeScript 6.0.36.68 s7.67 sn/a234,740707,312
Sources, TypeScript 7.0.21.61 s1.71 sn/a276,225839,577
Sources, TypeScript 7.0.2 single-threaded1.67 s1.76 sn/a259,464815,224
Full suite with type tests, TypeScript 6.0.3Out of memory (cause not recorded)
Full suite with type tests, TypeScript 7.0.2Out of memory (cause not recorded)

Reproduce it

Node.js 22 or later and git. Target: type-fest at commit 2fbae25.

Source and raw results
npm install && npm run lab:002