TLDR Tech / Dev
Reducing Zod's Memory Footprint by an Order of Magnitude with Method Memoization
Zod 4.5 cuts schema memory use by creating bound methods only when they are first accessed instead of attaching dozens of closures to every instance. A bare z.string() now retains 784 bytes instead of 7.5 KB, with 2× to nearly 10× reductions across the benchmarked schema types.
Read the full story