ALEXKRI.NET
Resume Contact
← Back

Zod Brings In-Process Schema Compilation and a 9x Cut in Memory Footprint

Good set of numbers out of Zod 4.5 and 4.6: z.compile() parses 3-9x faster, and a bare z.string() now retains 784 bytes instead of 7.5 KB — roughly 9x less memory, mostly from memoising bound methods instead of allocating them per instance. Compilation happens in-process (node —import zod/compile), so there’s no bundler plugin or codegen step to adopt. On a library with 30M weekly downloads, the memory line is probably the bigger win.

Read the source ↗