DEV Community

Cover image for TypeScript checker benchmark: 309 errors or none, on the same repo
Aleksandr Argunov
Aleksandr Argunov

Posted on Originally published at argbe.tech AI-assisted

TypeScript checker benchmark: 309 errors or none, on the same repo

Run five TypeScript checkers on a fresh clone of date-fns and you get the same 309 errors. Run bun check and you get none. Same commit, same package.

Six new checkers appeared in 14 days. Their own benchmarks report up to 11.4× over TypeScript 7. The best independent number is 5.8× on VS Code. So here's a smaller test that looks at diagnostics first.

Independent numbers so far

Against TypeScript 7.0.2, at default threads:

Checker type-fest Outline VS Code NestJS app
tsrs 4.3× 5.6× 5.8× 3.64×
bun check 5.7× 3.7× 3.3× 1.79×
tsc-ts 4.5× 3.7× 2.2× not run
tsc-rs 3.3× 2.5× 2.4× 2.46×

The first three columns are Daniel Fry's run, on an Apple M5, Oct 19. The last is AIHUB BE's run, on a 4-vCPU GitHub runner, Oct 21. In Fry's VS Code run, tsrs falls from 5.8× to 4.2× at four threads and 3.2× at one. It also reports 10 extra errors against 7.0.2, because it tracks 7.1-dev.

Setup

Retest date: Nov 3, 2026. Machine: Apple M1 Pro, 10 CPUs, 16 GiB, macOS 27.0.1, AC power, Node v26.13.0. It wasn't idle: 1-minute load ranged from 6.5 to 28.7. ts-r, tsc-haxe and tsz weren't tested.

{
    "name": "checkers",
    "private": true,
    "dependencies": {
        "ts702": "npm:typescript@7.0.2",
        "ts71beta": "npm:typescript@7.1.0-beta",
        "tsc-rs": "0.8.0",
        "tsc-ts": "0.1.0",
        "tsrs": "0.20.1-ts7.1.0-beta",
        "bun": "1.4.4"
    }
}
Enter fullscreen mode Exit fullscreen mode
npm install --ignore-scripts --no-audit --no-fund
(cd node_modules/bun && node install.js)
export C=$PWD/node_modules
Enter fullscreen mode Exit fullscreen mode

309 errors, or none

git clone https://github.com/date-fns/date-fns.git && cd date-fns
git checkout a9739fb3e538
pnpm install --ignore-scripts --frozen-lockfile
$C/ts702/bin/tsc -p pkgs/core --noEmit --pretty false; echo "exit $?"
$C/.bin/bun check -p pkgs/core --no-script --no-pretty; echo "exit $?"
Enter fullscreen mode Exit fullscreen mode
pkgs/core/scripts/build/fp.ts(10,43): error TS6305: Output file '<repo>/pkgs/docs/.ts/src/index.d.ts' has not been built from source file '<repo>/pkgs/docs/src/index.ts'.
... 309 diagnostics in total ...
exit 1
✓ No type errors in 1,695 files [394.05ms]
exit 0
Enter fullscreen mode Exit fullscreen mode
Checker Errors Exit
TypeScript 7.0.2 309 1
TypeScript 7.1 beta 309 2
tsc-rs 0.8.0 309 2
tsc-ts 0.1.0 309 2
tsrs 0.20.1 309 2
bun check 1.4.4 0 0

The five tsc-style outputs hash the same once the clone path is removed. Of the 309, 307 are TS6305. bun check --help says references are followed "and nothing has to be built first". After tsc -b with 7.0.2, all six exit 0. bun check counts 1,695 files and 7.0.2 counts 2,287, and this run didn't reconcile them.

The root is worse. tsc -p . --extendedDiagnostics prints Files: 0, because the root config has "include": [] and only references. All five exit 0.

Seeded errors

test-d/seeded-error.ts in type-fest at b550b410e13f:

const count: number = 'three'
export const label: string = count
export const greet = (name: string) => name.toUpperCase()
greet(42)
export const missing = greet.nope
Enter fullscreen mode Exit fullscreen mode

All six report the same four lines: TS2322, TS2322, TS2345 and TS2339. The exit code splits. 7.0.2 and bun check exit 1. The 7.1 beta, tsc-rs, tsc-ts and tsrs exit 2. AIHUB BE saw the same split. A CI rule on one exact code won't survive a switch.

Timings

Through /usr/bin/time -l, rotating order, 1 warm-up, median of 7. One thread is --singleThreaded, or --threads=1 for bun. date-fns ran as -p pkgs/core, after tsc -b.

Checker type-fest, one thread date-fns, one thread date-fns, default
TypeScript 7.0.2 25.10 s (1.0×) 1.19 s (1.0×) 0.72 s (1.0×)
TypeScript 7.1 beta 14.28 s (1.8×) 1.01 s (1.2×) 0.65 s (1.1×)
tsc-rs 6.96 s (3.6×) 0.71 s (1.7×) 0.40 s (1.8×)
tsc-ts 8.33 s (3.0×) 0.84 s (1.4×) 0.40 s (1.8×)
tsrs 7.90 s (3.2×) 0.32 s (3.7×) 0.20 s (3.7×)
bun check 5.28 s (4.8×) 0.70 s (1.7×) 0.27 s (2.7×)

Load during those columns ranged from 6.5 to 14.3. These are rough numbers from one busy machine.

Don't cite type-fest at default threads from this run. bun check read 12.1× with load between 20.4 and 28.7. A rerun stopped after four samples and read 22.9×, with 7.0.2 between 17.55 s and 83.79 s. The cause wasn't isolated. Fry's 5.7× on an M5 is the better number.

Three checks for your own repo

  1. Read Files: from --extendedDiagnostics. A pass on zero files is not a pass.
  2. Seed errors. Compare the lines and the exit code with your current checker.
  3. Time the whole step on an idle machine, at default threads and at one thread. A checker can't speed up a code generator it doesn't run.

Pin the version you tested. In two weeks, tsc-ts went from reporting 7.0.2 to reporting 7.1.0-beta.

The claimed numbers for every project, with their conditions, are in the maintained article.

Top comments (0)