Skip to content

ArkType 3.0 ships a build-time compiler, claims 15x on Zod 4

A new @ark/aot plugin turns ArkType schemas into standalone validators at build time, with published benchmarks against Zod, Typia, ajv and TypeBox.

Source: ArkType

ArkType, the TypeScript-first schema validator, reached 3.0 and general availability on 3 December. The headline feature is @ark/aot, a plugin that precompiles each Type into a standalone validator at build time rather than interpreting the schema at runtime. It plugs into Vite, Rollup, Rolldown, webpack, Rspack, esbuild, Bun and Farm, with drivers for Node, Bun’s runtime and Next’s Turbopack.

ArkType’s own benchmarks put precompiled validators ahead of Zod 4 in all 32 scenarios tested, by a median of 15x, and ahead of Zod’s own z.compile in all 32, by a median of 5.3x. Gzipped bundle size came in 21.7% below Typia’s. Without the plugin, dynamic ArkType now ships at 98.1 kB gzipped, up from 47.8 kB in 2.2.9, which is the trade-off the new plugin exists to avoid.

import { precompile } from "@ark/aot/unplugin"

export default {
  plugins: [precompile.vite()]
}

A standalone compiled validator still validates, asserts and satisfies Standard Schema, but it loses runtime composition, introspection and locale support, and any definition only known at runtime needs a “runtime island” or a build with runtime: "arktype" set.

Why it matters: validation libraries sit on the hot path of every API route and form handler, so a free 15x on the common case is worth a look if you are already on ArkType or weighing it against Zod. The catch is the same one every compiler brings: a slower build in exchange for a faster runtime, and less flexibility for schemas that only exist at runtime.

Share

Related reading

More from The Wire

All briefs