zod-compiler turns Zod schemas into build-time validation functions, up to 43x faster

hichaelmart · x · 2026-08-19

Open-source zod-compiler compiles existing Zod schemas into zero-overhead validation functions at build time — 1.2–43x faster validation with no code changes, and up to 190x on rejected input. It works with Vite, webpack, esbuild and Rollup, and has been tested in large projects with tens of thousands of schemas.

Default automatic mode detects and compiles every exported Zod schema with no wrappers or extra imports. Developer thomasankcorn reported it halved their memory usage. The repo currently sits at 761 stars.

Original post →

More from coding & agent

coding & agent channel →