r/javascript • • Jun 11 '26

Compile Zod schemas into zero-overhead validators (2-74x faster)

https://github.com/gajus/zod-compiler
47 Upvotes

18 comments sorted by

View all comments

Show parent comment

0

u/gajus0 Jun 11 '26

There is a benchmark that compares zod-compiler against zod v3, v4, typia, and Ajv, https://github.com/gajus/zod-compiler#benchmark

6

u/Akkuma Jun 11 '26

I saw that, which is why I was asking about typedriver as it is from the same creator of typebox, which is already nearly as fast as Typia https://moltar.github.io/typescript-runtime-type-benchmarks/ and typedriver's benchmarks show a 20x improvement from Zod.

I'm guessing the performance is pretty similar between yours and typedriver as the benchmarks above have the original `@sinclair/typemap/zod` listed as well being close.