Contents
Benchmarks of TypeScript 7’s native compiler (tsgo) across macOS, Linux, and Windows, plus the build, linting, and declaration checks behind our migration.
When we migrated our 27-package TypeScript UI SDK from TypeScript 6.0.3 to the native TypeScript 7.0.2 compiler, clean build time dropped from 23.1 seconds to 1.4 seconds, as observed and measured on macOS utilizing an Apple M3 Ultra with 256 GB of RAM. That result combines two changes: consolidating the build script and upgrading the compiler. We measured them separately to show how much each change contributed.
At a glance: a clean build of the 27-package UI SDK
- Clean-build speedup, single-threaded
- 2.91× – 3.29×
- Higher is better · 2.91× macOS · 2.94× Linux · 3.29× Windows
- Clean-build speedup, default concurrency
- 6.56× – 8.02×
- Higher is better · 7.62× macOS · 6.56× Linux · 8.02× Windows
- Single-threaded peak RSS, macOS and Linux
- −68%
- Lower is better · 1,179 MiB → 376 MiB macOS · 1,125 MiB → 354 MiB Linux
- Byte-identical .d.ts files
- 682 / 708
- Remaining 26 files checked against a downstream consumer
Benchmark method: TypeScript Project References and tsc --build
Our UI software development kit (SDK) is a monorepo containing 27 packages linked by TypeScript Project References. Foundational packages, such as design tokens and base UI primitives, support higher-level packages such as data tables, document viewers, and application shells. Each package compiles against the .d.ts declaration files produced by its dependencies, so those dependencies must be built first.
Previously, our build script followed dependency order in a custom loop. It deleted each package's dist folder and launched a separate tsc process, for 27 compiler invocations in total. Under TypeScript 6, this repeated Node.js startup and compiler initialization for every package. TypeScript's build mode, tsc --build (or tsc -b), manages the referenced projects in one invocation and builds dependencies first. On TypeScript 6.0.3, that script change alone cut the macOS clean-build median from 23.071 seconds to 10.782 seconds (Apple M3 Ultra, 256 GB RAM), before we changed compilers.
We used the same single tsc -b invocation as the baseline for both compilers. The source commit, lockfile, and node_modules tree stayed fixed. We compared five execution modes; Table 2 also includes a --checkers 8 run and the legacy 27-process script for reference:
- TypeScript 6.0.3 baseline (ts6): The JavaScript-based TypeScript 6.0.3 compiler executing on Node.js 24.22.0 in a single process across the 27-package dependency graph.
- TypeScript 7.0.2 single-threaded (ts7-single): The native TypeScript 7.0.2 compiler, written in Go and previewed as tsgo, invoked with
--singleThreadedso all compiler work runs on one thread. - TypeScript 7.0.2 single type-checker (ts7-checkers-1): Restricts type-checking to one type-checker worker per project (
--checkers 1) while allowing file parsing, binding, declaration emit, and multi-project graph orchestration to run concurrently. - TypeScript 7.0.2 default concurrency (ts7-default): Runs the native compiler with its out-of-the-box worker pool (defaulting to 4 type-checker workers per project plus parallel project builders up to the available graph concurrency).
- TypeScript 7.0.2 bounded builders (ts7-builders2): Caps parallel project builders at two (
--builders 2) with other defaults unchanged. This limits how many packages compile at once (matching our production build driver); it does not simulate a smaller CI machine.
Editor language-service latency, bundler pipelines (such as next build, SWC, or esbuild), and the runtime speed of emitted JavaScript are outside the scope of this study; every measurement below isolates tsc compilation and type-checking.
TypeScript 7 vs TypeScript 6: build and type-checking benchmarks
Measured with hyperfine 2.0.0 (3 warmup runs, 10 to 30 timed runs, warm OS file cache). Before every timed clean-build run, an untimed preparation step deletes all 27 dist directories and .tsbuildinfo files.
- TypeScript 6.0.3
- TypeScript 7.0.2 single-threaded
- TypeScript 7.0.2 default
27-package UI SDK: clean build (macOS · M3 Ultra, 256 GB RAM)
tsc -b across 27 composite packages on macOS · emits JS + 708 .d.ts files (mean of 10 runs)
27-package UI SDK: clean build (Linux · Core i9-12900HK, 32 GB RAM)
tsc -b across 27 composite packages on Ubuntu 26.04 LTS (mean of 10 runs)
27-package UI SDK: clean build (Windows Server 2025 · Core i9-13900H, 96 GB RAM)
tsc -b across 27 composite packages on Windows Server 2025 (mean of 10 runs; 30 for single-threaded) · medians 27.967 s → 8.053 s single-threaded
27-package UI SDK: per-package type-check loop (macOS · M3 Ultra, 256 GB RAM)
27 separate tsc --noEmit runs plus the Storybook project, checked against built declarations
Internal Next.js application: type-check (macOS · M3 Ultra, 256 GB RAM)
Production web application · 536 TS/TSX files · ~609k type instantiations (from tsc --extendedDiagnostics)
Microsoft Playwright, root project: type-check (macOS · M3 Ultra, 256 GB RAM)
microsoft/playwright @ 98891e9 · 772 source files · ~601k type instantiations
tsgo performance: single-threaded builds and default concurrency
We first ran TypeScript 7.0.2 with --singleThreaded, disabling compiler parallelism for comparison with TypeScript 6.0.3 (each runtime still uses background threads for garbage collection). These results compare the two compiler implementations before enabling concurrent compiler work:
- macOS (Apple M3 Ultra, 28 cores, 256 GB RAM): Clean 27-package build time drops from 10.842 seconds on TypeScript 6.0.3 to 3.729 seconds on single-threaded TypeScript 7.0.2—a 2.91× speedup—while peak resident set size (RSS) drops 68%, from 1,179 MiB down to 376 MiB.
- Ubuntu Linux (Intel Core i9-12900HK, 14 cores / 20 threads, 32 GB RAM): Clean 27-package build time drops from 11.646 seconds on TypeScript 6.0.3 to 3.962 seconds on single-threaded TypeScript 7.0.2—a 2.94× speedup—while peak RSS drops 69%, from 1,125 MiB down to 354 MiB.
- Windows Server 2025 (Intel Core i9-13900H, 14 cores / 20 threads, 96 GB RAM): Clean 27-package build time drops from 28.394 seconds on TypeScript 6.0.3 to 8.630 seconds on single-threaded TypeScript 7.0.2—a 3.29× mean speedup (or 3.47× by median, dropping from 27.967 seconds to 8.053 seconds across 30 timed runs).
Once multi-core concurrency is enabled, TypeScript 7 parallelizes work across two dimensions: project builders (--builders N), which compile independent packages in the dependency graph simultaneously, and type-checker workers (--checkers N), which partition and type-check a single project's files across multiple workers. Stepping through those concurrency settings shows where the additional speedup comes from—and where adding more workers stops helping:
- One type-checker worker per project (
--checkers 1): With type-checking still on one worker per project, letting parsing, binding, emit, and project builds run in parallel cuts the median clean build from 3.710 s to 1.967 s on macOS and from 3.954 s to 2.260 s on Linux. Total CPU time was 4.73× wall-clock time on macOS and 3.25× on Linux, meaning roughly that many cores were busy on average. - Default concurrency (4 checkers): Under TypeScript 7's default pool, the median clean build falls to 1.425 s on macOS (7.57× faster than TypeScript 6; 1.422 s / 7.62× by mean) and 1.771 s on Linux (6.56×); on Windows the mean clean build falls to 3.540 s (8.02×).
- Diminishing returns beyond 4 checkers on high-core and hybrid CPUs: On the 28-core Apple M3 Ultra, raising
--checkersfrom 4 to 8 lowers the median clean build from 1.425 s to 1.378 s; further increases up to 36 checkers (more than the core count) stayed between 1.41 s and 1.50 s. On the hybrid Intel Core i9-12900HK (6 performance cores with Hyper-Threading plus 8 efficiency cores), 8 checkers was slightly slower than 4 (1.844 s against 1.771 s). Scheduling across performance and efficiency cores is one possible explanation; these measurements do not establish the cause. - Parallel project builders on Windows Server 2025: On our Windows Server 2025 host, processor boost was disabled (2.60 GHz cap), and the build wrote 708 declaration files plus JavaScript output to NTFS. TypeScript 6.0.3 averaged 28.394 s in this configuration. While the single-threaded TypeScript 7.0.2 clean build averaged 8.630 s (8.053 s median across 30 runs, a 3.29× mean / 3.47× median speedup), enabling default concurrency reduced build time to 3.540 s (8.02×) with a tight 3.483–3.769 s range across ten runs.
TypeScript 7 vs 6: clean-build benchmarks for the 27-package UI SDK
Mean wall-clock time in seconds (min–max range in parentheses) for a clean tsc -b build of the same source commit across all three operating systems.
| macOS · M3 Ultra, 256 GB | Linux · i9-12900HK, 32 GB | Windows · i9-13900H, 96 GB | ||||
|---|---|---|---|---|---|---|
| Compiler mode | Mean | Speedup | Mean | Speedup | Mean | Speedup |
| TypeScript 6.0.3 (Node.js 24.22.0) | 10.842 s(10.557–11.260) | 1.00× | 11.646 s(11.512–11.866) | 1.00× | 28.394 s(26.944–30.305) | 1.00× |
| TypeScript 7.0.2 (--singleThreaded) | 3.729 s(3.643–3.843) | 2.91× | 3.962 s(3.944–3.998) | 2.94× | 8.630 s(7.776–10.045) | 3.29×(3.47× med) |
| TypeScript 7.0.2 (default concurrency) | 1.422 s(1.393–1.443) | 7.62× | 1.774 s(1.744–1.810) | 6.56× | 3.540 s(3.483–3.769) | 8.02× |
Compiler concurrency benchmarks: clean-build time and peak RSS
Medians of 10 timed runs (after 3 warmup runs) on macOS (M3 Ultra, 256 GB RAM) and Linux (Core i9-12900HK, 32 GB RAM), so the TypeScript 6 baseline differs by a few hundredths of a second from the means in Table 1. Memory is peak resident set size (RSS), reported by hyperfine's memory_peak_resident metric in mebibytes (MiB). The metric records the largest per-process peak across the command and its child processes. The legacy 27-process script's memory figure is the peak of a single per-package tsc process. Peak memory was not captured on Windows.
| macOS · M3 Ultra, 256 GB | Linux · i9-12900HK, 32 GB | |||||
|---|---|---|---|---|---|---|
| Configuration | Median | Speedup | Peak RSS | Median | Speedup | Peak RSS |
| ts6 (TypeScript 6.0.3 baseline) | 10.782 s | 1.00× | 1,179 MiB | 11.622 s | 1.00× | 1,125 MiB |
| ts7-single (--singleThreaded) | 3.710 s | 2.91× | 376 MiB | 3.954 s | 2.94× | 354 MiB |
| ts7-checkers-1 (--checkers 1) | 1.967 s | 5.48× | 526 MiB | 2.260 s | 5.14× | 496 MiB |
| ts7-default (default 4 checkers) | 1.425 s | 7.57× | 718 MiB | 1.771 s | 6.56× | 687 MiB |
| ts7-checkers-8 (--checkers 8) | 1.378 s | 7.82× | 815 MiB | 1.844 s | 6.30× | 800 MiB |
| ts7-builders2 (--builders 2) | 1.768 s | 6.10× | 579 MiB | 2.099 s | 5.54× | 556 MiB |
| ts6-old-script (legacy 27-process loop) | 23.071 s | 0.47× | 543 MiB | not run(macOS reference only) | — | — |
Package builds, application type-checking, and incremental-build benchmarks
Medians for a single foundation package (base UI primitives, 182 source files), a mid-sized internal Next.js application (536 source files), an open-source reference codebase (the root project of Microsoft Playwright, 772 source files), and incremental rebuilds of the UI SDK. In the per-package type-check loop, single-threaded TypeScript 7 achieved a 4.08×–4.14× speedup. Both versions launched 28 separate tsc --noEmit processes; these measurements include repeated process startup, including Node.js startup for TypeScript 6.
| TypeScript 7.0.2 single-threaded | TypeScript 7.0.2 default | ||||
|---|---|---|---|---|---|
| Machine | TypeScript 6.0.3 | Time | Speedup | Time | Speedup |
| Foundation package (182 files) · Type-check (--noEmit) | |||||
| macOS · M3 Ultra | 1.498 s | 0.436 s | 3.44× | 0.275 s | 5.45× |
| Linux · i9-12900HK | 1.645 s | 0.483 s | 3.41× | 0.340 s | 4.84× |
| Foundation package (182 files) · Clean build | |||||
| macOS · M3 Ultra | 1.609 s | 0.486 s | 3.31× | 0.328 s | 4.91× |
| Linux · i9-12900HK | 1.777 s | 0.528 s | 3.37× | 0.351 s | 5.06× |
| Internal Next.js app (536 files, ~609k type instantiations) · Type-check | |||||
| macOS · M3 Ultra | 5.403 s | 1.634 s | 3.31× | 0.729 s | 7.41× |
| Microsoft Playwright (root project, 772 files, ~601k instantiations) · Type-check | |||||
| macOS · M3 Ultra | 6.145 s | 1.934 s | 3.18× | 0.871 s | 7.06× |
| UI SDK (27 projects) · Per-package type-check loop | |||||
| macOS · M3 Ultra | 21.746 s | 5.331 s | 4.08× | 3.577 s | 6.08× |
| Linux · i9-12900HK | 26.749 s | 6.464 s | 4.14× | 4.590 s | 5.83× |
| UI SDK · Incremental build, no changes (tsc -b) | |||||
| macOS · M3 Ultra | 0.101 s | 0.039 s | 2.59× | 0.027 s | 3.74× |
| UI SDK · Incremental build after a 1-file edit in the foundation package (rebuilds dependents) | |||||
| macOS · M3 Ultra | 5.992 s | 2.152 s | 2.78× | 1.072 s | 5.59× |
Even with concurrency disabled, the native compiler ran clean builds 2.9× to 3.3× faster than TypeScript 6 and, on macOS and Linux, used about a third of the peak memory.
TypeScript 7 migration guide: linting, declarations, and module resolution
The native TypeScript 7 compiler is close to a drop-in replacement for command-line builds, but much of the surrounding ecosystem is built on the JavaScript compiler API of TypeScript 5 and 6 and pins strict npm peer-dependency ranges. Our SDK migration addressed two engineering questions, and our Playwright benchmark surfaced a third configuration change that other codebases are likely to encounter.
typescript-eslint and TypeScript 7: our move to oxlint type-aware linting
Syntax-based lint rules inspect a single file's syntax tree in isolation. Type-aware lint rules also query TypeScript's type checker across the program to catch issues such as unawaited Promises and unsafe assignments involving any.
typescript-eslint 8.71.x supports TypeScript >=4.8.4 <6.1.0 and depends on its in-process JavaScript compiler API. Teams can retain TypeScript 6 alongside TypeScript 7 specifically for API-dependent tooling while using TypeScript 7 for builds, or move type-aware linting to a native tool. We chose to move our type-aware rules to oxlint:
- Syntax, accessibility, and import-boundary rules: Retained in ESLint using
@babel/eslint-parserconfigured with@babel/preset-typescript. - Type-aware rules (43 rules): Moved from typescript-eslint's
recommendedTypeCheckedpreset tooxlint --type-aware, powered by tsgolint through theoxlint-tsgolintpackage. Forty of the 43 rules kept their exact rule names, and the other three mapped directly to oxlint core rules.
Checking .d.ts compatibility for downstream consumers
Downstream applications use the SDK's emitted .d.ts declaration files for type-checking. Across the 708 .d.ts files emitted by our 27 packages, 682 were byte-for-byte identical between TypeScript 6.0.3 and TypeScript 7.0.2. The 26 files that differed fell into five categories:
- Quote and whitespace formatting (11 files): Single-quote versus double-quote or whitespace differences only.
- Union and object-member ordering (10 files): Identical member sets emitted in a different order.
- Static component properties (2 files): Two React components with static properties emitted namespace declarations instead of call-signature object types or typeof variable aliases.
- Conditional typeof window expression (1 file): An isomorphic layout-effect helper simplified its conditional hook type alias.
- Generated schema validators (2 files): Two generated Ajv validators emitted a variable alias plus function instead of a function plus namespace.
To test the 26 changed files, we packed the TypeScript 7 outputs into tarballs and installed them in one production Next.js application still using TypeScript 6.0.3. The application produced zero new diagnostics, and an automated probe checked all 32 package entry points for unexpected any types. These checks found no regression in the tested consumer.
Fixing TS5108: replacing moduleResolution node10
TypeScript 7 removes configuration options that TypeScript 6.0 deprecated. In Microsoft Playwright (commit 98891e9), the root tsconfig.json type-checked cleanly on both compilers, but packages/extension/tsconfig.json and packages/extension/tsconfig.ui.json failed immediately on TypeScript 7 with error TS5108 because they set "moduleResolution": "node10".
When upgrading to TypeScript 7, replace moduleResolution: "node10" (or its legacy alias "node") with a supported mode such as "bundler", "node16", or "nodenext". Choose the mode that matches the project's runtime or bundler, and review the corresponding module setting.
TypeScript 7 migration examples: .d.ts output and TS5108
# Component with a static displayName property (excerpt from an emitted .d.ts file)-declare const DropdownMenuShortcut: {- ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;- displayName: string;-};+declare function DropdownMenuShortcut({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;+declare namespace DropdownMenuShortcut {+ var displayName: string;+} # Legacy moduleResolution in Playwright extension configs (TS5108)$ tsc --noEmit -p packages/extension/tsconfig.jsonpackages/extension/tsconfig.json(5,25): error TS5108: Option 'moduleResolution=node10' has been removed. Please remove it from your configuration.Benchmark environment: compiler versions, hardware, and operating systems
All measurements used checksum-verified Node.js 24.22.0 and hyperfine 2.0.0 binaries installed in isolated user directories, comparing typescript@6.0.3 against the native typescript@7.0.2 binary using the same source commit and lockfile for each codebase under both compilers.
- TypeScript 6
- typescript@6.0.3 (JS on Node 24.22.0)
- TypeScript 7
- typescript@7.0.2 (native binary)
- Node.js
- v24.22.0 (SHASUMS256 verified)
- Benchmark runner
- hyperfine 2.0.0 (--warmup 3; --runs 10, or 30 for Windows TS 7 single-threaded)
macOS ARM64
Apple M3 Ultra · 256 GB RAM
- Processor
- Apple M3 Ultra
- Cores
- 28 cores (20 P-cores + 8 E-cores, 28 threads)
- Memory
- 256 GB unified memory
- Storage
- 2 TB internal Apple SSD (APFS)
- OS / Kernel
- macOS 27.0.1
Measured on bare metal with Low Power Mode disabled.
Linux x86_64
Intel Core i9-12900HK · 32 GB RAM
- Processor
- 12th Gen Intel Core i9-12900HK (up to 5.0 GHz)
- Cores
- 14 cores / 20 threads (6 P-cores w/ Hyper-Threading + 8 E-cores)
- Memory
- 32 GB DDR5
- Storage
- 1 TB NVMe SSD mirror (software RAID 1, ext4)
- OS / Kernel
- Ubuntu 26.04 LTS (Linux 7.0 kernel)
Measured on bare metal with the default intel_pstate power management (powersave governor, balance_performance energy preference).
Windows x86_64
Intel Core i9-13900H · 96 GB RAM
- Processor
- 13th Gen Intel Core i9-13900H (2.60 GHz base)
- Cores
- 14 cores / 20 threads (6 P-cores w/ Hyper-Threading + 8 E-cores)
- Memory
- 96 GB DDR5
- Storage
- 1 TB NVMe SSD (NTFS)
- OS / Kernel
- Windows Server 2025 Standard (24H2)
Measured in native Windows shell (not WSL) on an NTFS NVMe volume with processor performance boost disabled (2.60 GHz cap).
In brief
Summary of findings
Single-threaded TypeScript 7.0.2 completed a clean tsc -b build of the 27-package UI SDK 2.91× to 3.29× faster than TypeScript 6.0.3.
Build times fell from 10.842 s → 3.729 s, as observed and measured on macOS utilizing an Apple M3 Ultra with 256 GB of RAM (2.91×). They fell from 11.646 s → 3.962 s on Ubuntu Linux utilizing an Intel Core i9-12900HK with 32 GB of RAM (2.94×), and from 28.394 s → 8.630 s on Windows Server 2025 utilizing an Intel Core i9-13900H with 96 GB of RAM (3.29× by mean, 3.47× by median).
With TypeScript 7's default concurrency enabled, clean 27-package build times drop to 1.422 s on macOS (7.62×), 1.774 s on Linux (6.56×), and 3.540 s on Windows Server 2025 (8.02×).
Peak resident set size (RSS) on the 27-package clean build fell 68–69% in single-threaded mode (1,179 MiB → 376 MiB on macOS; 1,125 MiB → 354 MiB on Linux) and 39% under default concurrency (1,179 MiB → 718 MiB on macOS; 1,125 MiB → 687 MiB on Linux).
Windows peak memory was not measured.
Before upgrading the compiler, we replaced 27 separate tsc invocations with one TypeScript 6 tsc -b build.
Median build time fell from 23.071 s to 10.782 s, saving 12.289 seconds. We measured this separately from the TypeScript 7 speedup.
Of 708 emitted .d.ts files, 682 were byte-identical between TypeScript 6.0.3 and 7.0.2.
We checked the remaining 26 in a downstream Next.js application and probed all 32 package entry points for unexpected any types.
typescript-eslint 8.71.x supports TypeScript >=4.8.4 <6.1.0 through its JavaScript compiler API.
We chose ESLint with @babel/eslint-parser for syntax, accessibility, and import-boundary rules, and moved all 43 type-aware rules to oxlint --type-aware, powered by tsgolint.





