Zod 4.5 adds in-process schema compilation, cuts memory 9x
Zod 4.5 introduced z.compile(), which turns schemas into precompiled validators that parse data 3–9x faster, and cut schema memory usage roughly ninefold, from 7.5KB to 784 bytes for a bare z.string(). Compilation runs in-process with no bundler plugin; version 4.6 added a .validate() method and fixed a recursive-schema memory regression.
- z.compile() speeds up data parsing by 3–9x
- Memory for z.string() drops from 7.5KB to 784 bytes
- safeParse() rejects invalid input about 7.5x faster
- 4.6 adds .validate() and fixes recursive-schema memory leak
Read next
Software