Benchmarks
tsgo-strict does the same job as the original typescript-strict-plugin: flip "strict": true on an opted-in subset of files, type-check them, and filter the rest. The difference is the engine underneath — tsgo-strict drives the native TypeScript compiler shipped in TypeScript 7+ (the typescript package, formerly the tsgo native preview) from a Rust coordinator, while typescript-strict-plugin shells out to the older JavaScript tsc.
Methodology
Hardware: Linux dev container. perf-demo/ has 4,001 TS files across 20 batches, generated by perf-demo/scripts/generate.mjs. 5 warm runs each (1 warmup discarded), medians reported. Both CLIs run with cwd=perf-demo so node_modules (and @types/node) resolve identically.
- tsgo-strict:
target/release/tsgo-strict --project tsconfig.json - tsc-strict:
node_modules/.bin/tsc-strict -p tsconfig.json(fromtypescript-strict-plugin2.4.4,typescript5.6.3)
Wall-clock (median of 5 runs)
| Scenario | tsc-strict (ms) | tsgo-strict (ms) | Speedup |
|---|---|---|---|
| Full project | 6,540 | 852 | ~7.7× |
tsc-strict on full-project runstsc --showConfig)Where tsgo-strict's time goes
Phase timings collected via the programmatic API (timings[] on the result), median of 5 warm runs:
| Phase | tsgo-strict (ms) |
|---|---|
config-load | ~0 |
file-resolution | 205 |
strict-run (tsgo compile) | 587 |
The wall-clock is dominated by strict-run — the actual type-check done by tsgo — and file-resolution, which reads the first 4 KB of each of the 4,001 files in parallel to scan for // @ts-strict / // @ts-strict-ignore pragmas. config-load rounds to zero.
Why the gap is this large
Most of the 7–8× comes from the compiler, not from Rust:
- JavaScript
tsc→ native compiler. The native TypeScript 7 compiler is the bulk of the win. It does the same type-check as the older JavaScripttscbut in native code with parallel work, so the compile step is several times faster on the same project. - Config load is free.
tsgo-strictparsestsconfig.json(plus itsextendschain) in Rust in well under a millisecond.tsc-strictfirst shells out totsc --showConfigjust to read the plugin block, which costs ~100 ms of Node startup before it does any real work. - Pragma scanning goes parallel. Deciding which files are "strict" requires reading the head of each file to look for pragmas.
tsgo-strictdoes this across cores withrayon;tsc-strictpost-processestsc --listFilesoutput serially in Node.
Reproduce these locally
The perf-demo/ workspace generates a synthetic 4,001-file project:
pnpm perf:generate # materializes perf-demo/src/
(cd perf-demo && npm install --no-save typescript typescript-strict-plugin @types/node)
bash scripts/bench-vs-tsc-strict.sh # runs both CLIs, prints a median tableNumbers will vary with your hardware, but the shape — tsgo-strict finishing under a second on 4,000 files while tsc-strict spends several seconds in tsc — is stable.