RunTypes

Type Checking

What each way of declaring a type costs the TypeScript compiler.

Every time the compiler meets a generic type it expands it, and each expansion is one instantiation. TypeScript counts them, and the count is a good measure of how much work a type makes the checker do. It is paid on every build and on every keystroke in your editor, whatever you validate at runtime, so a type that is expensive here is expensive all day.

The charts compare ways of declaring the same type. RunTypes appears twice, once as a plain TypeScript type and once through its type builders, beside the schema builders of typia, TypeBox and zod. Lower is better, and zero is both real and best: it means the compiler resolved the declaration without expanding a single generic.

AJV has no bar here, and that is the point rather than an omission. It validates a JSON Schema document and recovers no TypeScript type from it, so there is nothing for the compiler to expand and nothing to measure.
$ loading benchmark…
Copyright © 2026