On this page
Abstract
How much faster does TypeScript 7 type-check a real, type-heavy library than TypeScript 6, how much of the gain comes from the native compiler rather than parallel checking, and what happens to memory? type-fest was checked at a pinned commit with TypeScript 6.0.3 and 7.0.2 on an Apple M3 Pro, with a discarded warm-up per condition and interleaved runs. TypeScript 7 checked the library sources 3.5× faster (2.6× from the native compiler alone, 1.3× from parallel checking) and the full suite with type tests 5.3× faster, while peaking higher in memory (11.6 GiB against 10.4 GiB). The main limit: one library, and only one machine measured with this protocol so far, with other applications open.
Key numbers
3.5×
faster check of the library sources, TypeScript 7 vs 6
ratio of median check times
Apple M3 Pro,
2.6×
faster from the native compiler alone, TypeScript 7 single-threaded vs 6
ratio of median check times
Apple M3 Pro,
5.3×
faster on the full suite with type tests
ratio of median check times
Apple M3 Pro,
11.6 GiBvs 10.4 GiB
peak memory on the full suite, TypeScript 7 vs TypeScript 6
median peak RSS
Apple M3 Pro,
1Introduction
TypeScript 7 is a native port of the compiler. Teams planning the move want to know what it changes for their own checks: how much faster CI gets, whether the gain needs a machine with many cores, and whether memory goes up or down.
type-fest is a demanding test for those questions: a widely used library made almost entirely of complex types, with a suite of type tests that is much heavier than the library itself. Measuring both workloads separates the everyday case from the stress case.
2Method
Subject
type-fest at a pinned commit, in two workloads: the library sources only (index.d.ts and source/), and the full suite including the type tests (test-d/). TypeScript 7 is also run with --singleThreaded, to separate the native compiler from parallel checking, and with --checkers set to several values in a separate series. The full suite is checked with TypeScript 6 twice: with Node.js's default heap, run once to record the error, and with a larger heap.
Target: type-fest at commit 2fbae25. Each run is tsc -p <project> --extendedDiagnostics.
Environment and protocol, per machine
Apple M3 Pro, 12 cores
- CPU
- Apple M3 Pro
- Cores
- 12
- RAM
- 36 GB
- OS
- Darwin 25.2.0
- Node.js
- 22.23.3
- Compilers
- TypeScript 6.0.3, TypeScript 7.0.2
Protocol
- Runs per condition
- 5 to 8, per condition below
- Warm-up
- 1 per condition, discarded, in every series except where noted below
- Order
- Interleaved (A B C A B C)
- Cooldown
- 120 s idle before each series
- Power
- AC power, Low Power Mode off
| Series | Warm-up | Interleaved | Load before1-minute average | Load after1-minute average |
|---|---|---|---|---|
sources | 1, discarded | yes | 5.00 | 4.18 |
checkers | 1, discarded | yes | 4.18 | 2.95 |
full-ts6-default-heap | none | yes | 2.95 | 3.61 |
full | 1, discarded | yes | 3.61 | 4.94 |
full-extra | 1, discarded | yes | 3.49 | 3.75 |
Conditions
- Sources, TypeScript 6.0.3, 7 runs
- Sources, TypeScript 7.0.2, 7 runs
- Sources, TypeScript 7.0.2 single-threaded,
--singleThreaded, 7 runs - Sources, TypeScript 7.0.2 with 1 checker,
--checkers 1, 5 runs - Sources, TypeScript 7.0.2 with 2 checkers,
--checkers 2, 5 runs - Sources, TypeScript 7.0.2 with 4 checkers,
--checkers 4, 5 runs - Sources, TypeScript 7.0.2 with 8 checkers,
--checkers 8, 5 runs - Full suite with type tests, TypeScript 6.0.3, out of memory at Node.js's default heap limit (4.0 GiB)
- Full suite with type tests, TypeScript 7.0.2, 8 runs
- Full suite with type tests, TypeScript 6.0.3, 16 GB heap,
NODE_OPTIONS=--max-old-space-size=16384, 8 runs - Full suite with type tests, TypeScript 7.0.2 single-threaded,
--singleThreaded, 8 runs
Intel Xeon, 1 core
- CPU
- Intel Xeon Processor @ 2.30GHz
- Cores
- 1
- RAM
- 4 GB
- OS
- Linux 6.18.44-fc-v230
- Node.js
- 22.22.2
- Compilers
- TypeScript 6.0.3, TypeScript 7.0.2
Protocol
- Runs per condition
- 3
- Warm-up
- None
- Order
- In sequence (A A A B B B)
- Cooldown
- Not recorded
Conditions
- Sources, TypeScript 6.0.3, 3 runs
- Sources, TypeScript 7.0.2, 3 runs
- Sources, TypeScript 7.0.2 single-threaded,
--singleThreaded, 3 runs - Full suite with type tests, TypeScript 6.0.3, out of memory (cause not recorded)
- Full suite with type tests, TypeScript 7.0.2, out of memory (cause not recorded)
Metrics
- Check time
- The "Check time" line printed by
tsc --extendedDiagnostics, in seconds: the time spent in the type checker only. - Total time
- The "Total time" line printed by
tsc --extendedDiagnostics, in seconds: parsing, binding and checking together. - Median
- The middle value of the measured runs, or the mean of the two middle values for an even count. Every reported figure is a median.
- Range
- The fastest and slowest measured runs, shown as whiskers on the charts.
- IQR
- Interquartile range, Q3 minus Q1, with quartiles by linear interpolation between order statistics.
- CV
- Coefficient of variation: sample standard deviation divided by the mean. Above 5%, the cause is investigated and logged.
- Peak memory
- 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. - Gain
- Ratio of two median check times. The native part compares TypeScript 6 with TypeScript 7 single-threaded; the parallel part compares single-threaded with the default mode. Their product is the total gain.
3Results
Apple M3 Pro, 12 cores
Bar: median. Whisker: fastest to slowest run.
Data table
| Condition | Runs | Median | Min | Max | IQR | CV |
|---|---|---|---|---|---|---|
| TypeScript 6.0.3 | 7 | 1.67 s | 1.66 s | 1.70 s | 0.010 s | 0.8% |
| TypeScript 7.0.2 | 7 | 0.484 s | 0.473 s | 0.492 s | 0.007 s | 1.3% |
| TypeScript 7.0.2 single-threaded | 7 | 0.636 s | 0.623 s | 0.639 s | 0.004 s | 0.9% |
Bar: median. Whisker: fastest to slowest run.
Data table
| Condition | Runs | Median | Min | Max | IQR | CV |
|---|---|---|---|---|---|---|
| TypeScript 7.0.2 with 1 checker | 5 | 0.642 s | 0.623 s | 0.668 s | 0.014 s | 2.6% |
| TypeScript 7.0.2 with 2 checkers | 5 | 0.518 s | 0.508 s | 0.529 s | 0.012 s | 1.7% |
| TypeScript 7.0.2 with 4 checkers | 5 | 0.475 s | 0.464 s | 0.493 s | 0.010 s | 2.3% |
| TypeScript 7.0.2 with 8 checkers | 5 | 0.377 s | 0.365 s | 0.387 s | 0.007 s | 2.2% |
Bar: median. Whisker: fastest to slowest run.
Data table
| Condition | Runs | Median | Min | Max | IQR | CV |
|---|---|---|---|---|---|---|
| TypeScript 6.0.3 | Out of memory at Node.js's default heap limit (4.0 GiB) | |||||
| TypeScript 7.0.2 | 8 | 14.1 s | 13.0 s | 15.8 s | 0.627 s | 6.7% |
| TypeScript 6.0.3, 16 GB heap | 8 | 74.6 s | 69.9 s | 82.6 s | 5.32 s | 5.5% |
| TypeScript 7.0.2 single-threaded | 8 | 23.0 s | 21.6 s | 24.9 s | 2.14 s | 5.6% |
Bar: median. Whisker: fastest to slowest run.
Data table
| Condition | Runs | Median | Min | Max | IQR | CV |
|---|---|---|---|---|---|---|
| TypeScript 7.0.2 | 8 | 11.6 GiB | 11.2 GiB | 12.3 GiB | 0.1 GiB | 2.5% |
| TypeScript 6.0.3, 16 GB heap | 8 | 10.4 GiB | 9.8 GiB | 10.8 GiB | 0.6 GiB | 3.5% |
| TypeScript 7.0.2 single-threaded | 8 | 9.6 GiB | 8.8 GiB | 9.9 GiB | 0.9 GiB | 5.1% |
| Factor | Ratio of medians | Conservative range |
|---|---|---|
| Native compilerTypeScript 6 / TypeScript 7 single-threaded | 2.6× | 2.60 to 2.73 |
| Parallel checkingTypeScript 7 single-threaded / default | 1.3× | 1.27 to 1.35 |
| TotalTypeScript 6 / TypeScript 7 default | 3.5× | 3.37 to 3.59 |
| Condition | Runs | Median | Min | Max | IQR | CV | Total timemedian | Peak RSSmedian |
|---|---|---|---|---|---|---|---|---|
| Sources, TypeScript 6.0.3 | 7 | 1.67 s | 1.66 s | 1.70 s | 0.010 s | 0.8% | 1.87 s | 557 MiB |
| Sources, TypeScript 7.0.2 | 7 | 0.484 s | 0.473 s | 0.492 s | 0.007 s | 1.3% | 0.510 s | 367 MiB |
| Sources, TypeScript 7.0.2 single-threaded | 7 | 0.636 s | 0.623 s | 0.639 s | 0.004 s | 0.9% | 0.675 s | 338 MiB |
| Sources, TypeScript 7.0.2 with 1 checker | 5 | 0.642 s | 0.623 s | 0.668 s | 0.014 s | 2.6% | 0.667 s | 355 MiB |
| Sources, TypeScript 7.0.2 with 2 checkers | 5 | 0.518 s | 0.508 s | 0.529 s | 0.012 s | 1.7% | 0.547 s | 369 MiB |
| Sources, TypeScript 7.0.2 with 4 checkers | 5 | 0.475 s | 0.464 s | 0.493 s | 0.010 s | 2.3% | 0.501 s | 376 MiB |
| Sources, TypeScript 7.0.2 with 8 checkers | 5 | 0.377 s | 0.365 s | 0.387 s | 0.007 s | 2.2% | 0.403 s | 367 MiB |
| Full suite with type tests, TypeScript 6.0.3 | Out of memory at Node.js's default heap limit (4.0 GiB), peak RSS 4.2 GiB | |||||||
| Full suite with type tests, TypeScript 7.0.2 | 8 | 14.1 s | 13.0 s | 15.8 s | 0.627 s | 6.7% | 14.2 s | 11.6 GiB |
| Full suite with type tests, TypeScript 6.0.3, 16 GB heap | 8 | 74.6 s | 69.9 s | 82.6 s | 5.32 s | 5.5% | 75.1 s | 10.4 GiB |
| Full suite with type tests, TypeScript 7.0.2 single-threaded | 8 | 23.0 s | 21.6 s | 24.9 s | 2.14 s | 5.6% | 23.3 s | 9.6 GiB |
Compiler counters and reported memory
| Condition | Memory reportedby the compiler, median | Instantiations | Types | Files |
|---|---|---|---|---|
| Sources, TypeScript 6.0.3 | 440 MiB | 707,312 | 234,740 | 338 |
| Sources, TypeScript 7.0.2 | 265 MiB | 839,577 | 276,225 | 338 |
| Sources, TypeScript 7.0.2 single-threaded | 249 MiB | 815,224 | 259,464 | 338 |
| Sources, TypeScript 7.0.2 with 1 checker | 250 MiB | 815,224 | 259,464 | 338 |
| Sources, TypeScript 7.0.2 with 2 checkers | 256 MiB | 825,383 | 266,340 | 338 |
| Sources, TypeScript 7.0.2 with 4 checkers | 264 MiB | 839,577 | 276,225 | 338 |
| Sources, TypeScript 7.0.2 with 8 checkers | 276 MiB | 856,115 | 288,128 | 338 |
| Full suite with type tests, TypeScript 7.0.2counters vary across runs | 10.1 GiB | 38,893,721 | 15,320,723 | 653 |
| Full suite with type tests, TypeScript 6.0.3, 16 GB heap | 10.5 GiB | 36,421,290 | 8,872,839 | 653 |
| Full suite with type tests, TypeScript 7.0.2 single-threadedcounters vary across runs | 7.0 GiB | 34,156,859 | 8,535,794 | 653 |
Intel Xeon, 1 core
Bar: median. Whisker: fastest to slowest run.
Data table
| Condition | Runs | Median | Min | Max | IQR | CV |
|---|---|---|---|---|---|---|
| TypeScript 6.0.3 | 3 | 6.68 s | 6.53 s | 6.92 s | 0.195 s | 2.9% |
| TypeScript 7.0.2 | 3 | 1.61 s | 1.59 s | 1.70 s | 0.055 s | 3.6% |
| TypeScript 7.0.2 single-threaded | 3 | 1.67 s | 1.61 s | 1.80 s | 0.095 s | 5.7% |
Full suite with type tests, Intel Xeon, Nov 3, 2026
- TypeScript 6.0.3: Out of memory (cause not recorded)
- TypeScript 7.0.2: Out of memory (cause not recorded)
| Factor | Ratio of medians | Conservative range |
|---|---|---|
| Native compilerTypeScript 6 / TypeScript 7 single-threaded | 4.0× | 3.62 to 4.29 |
| Parallel checkingTypeScript 7 single-threaded / default | 1.0× | 0.95 to 1.13 |
| TotalTypeScript 6 / TypeScript 7 default | 4.1× | 3.83 to 4.34 |
| Condition | Runs | Median | Min | Max | IQR | CV | Total timemedian | Peak RSSmedian |
|---|---|---|---|---|---|---|---|---|
| Sources, TypeScript 6.0.3 | 3 | 6.68 s | 6.53 s | 6.92 s | 0.195 s | 2.9% | 7.67 s | n/a |
| Sources, TypeScript 7.0.2 | 3 | 1.61 s | 1.59 s | 1.70 s | 0.055 s | 3.6% | 1.71 s | n/a |
| Sources, TypeScript 7.0.2 single-threaded | 3 | 1.67 s | 1.61 s | 1.80 s | 0.095 s | 5.7% | 1.76 s | n/a |
| Full suite with type tests, TypeScript 6.0.3 | Out of memory (cause not recorded) | |||||||
| Full suite with type tests, TypeScript 7.0.2 | Out of memory (cause not recorded) | |||||||
Compiler counters and reported memory
| Condition | Memory reportedby the compiler, median | Instantiations | Types | Files |
|---|---|---|---|---|
| Sources, TypeScript 6.0.3 | 353 MiB | 707,312 | 234,740 | 338 |
| Sources, TypeScript 7.0.2 | 264 MiB | 839,577 | 276,225 | 338 |
| Sources, TypeScript 7.0.2 single-threaded | 249 MiB | 815,224 | 259,464 | 338 |
4Discussion
Most of the speedup does not depend on cores. TypeScript 7 single-threaded is already 2.6× faster than TypeScript 6, and parallel checking adds 1.3× on top. On the one-core Intel Xeon, measured with the earlier protocol, the native compiler gives 4.0× and parallel checking 1.0×: small CI runners get most of the gain.
Memory is the surprise. On the full suite TypeScript 7 peaks higher than TypeScript 6 given a 16 GiB heap (11.6 GiB against 10.4 GiB), while TypeScript 7 single-threaded peaks at 9.6 GiB and takes 23 s. Parallel checking trades memory for time. TypeScript 6 cannot finish the full suite at all at Node.js's default heap limit (4.0 GiB).
The default mode does not use every core: --checkers 8 checked the sources 22% faster than the default mode, in a separate series.
Lab #001 measured the other lever: one costly type pattern, fixed, cut check time with TypeScript 7 as well as with TypeScript 6. Migrating does not remove the cost of a slow type, so the two gains add up.
5Limitations and threats to validity
- 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.
- 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. - 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. - One library (type-fest at one commit), check time only: no emit, watch mode or editor latency.
- 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×.
- 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.
- The checker series was measured with other applications open (load average 3.0 to 4.2), and in a separate series from the default mode: the comparison between
--checkers 8and the default mode crosses two series. - Results come from one machine per session: compare conditions within the same machine only.
6Conclusion and recommendations
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.
Most of the gain comes from the native compiler, so expect it even on small CI runners. The default mode does not use all available cores: on this 12-core machine, --checkers 8 checked the sources in 0.377 s, 22% faster than the default mode (0.484 s), and --checkers 4 took 0.475 s.
Recommendations
- Expect most of the gain even on small CI runners: it comes from the native compiler, not from the number of cores.
- Before switching a heavy type-test suite, measure its peak memory with TypeScript 7 and size CI runners on it, not on check time alone.
- On machines with many cores, try
--checkers: the default mode did not use all of them here. - Measure your own codebase with the same protocol before deciding: one library is not your project.
7Reproduce
Node.js 22 or later and git. From the repository root, run the experiment, then recompute every statistic from the results files. New results land in experiments/002-ts6-vs-ts7-type-fest/results/: open a pull request with yours to add a machine.
npm install && npm run lab:002node experiments/002-ts6-vs-ts7-type-fest/analyze.mjs8Data
9Changelog
First published at 4.0×; corrected to 3.5× after adding a warm-up run and interleaving.