Replies: 1 comment
-
|
I built this — https://github.com/wakita181009/zod-aot compiles Zod v4 schemas into optimized validation functions at build time. Zod v4 already has JIT compilation, but it still traverses the schema tree and dispatches per-node at runtime. Zod AOT fully inlines all field validations into a single flat function — no traversal, no dispatch overhead. This results in 2-64x faster validation, with the gap growing as schema complexity increases.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
zod's performance is currently lagging behind some of the other runtime data validations libraries that are out there.Other than improving the performance in general, it would also be awesome to have the ability to generate Ahead of Time compiled validation functions in order to improve performance similar to what the Typebox library offers in order to improve performance for validations that run in performance critical code.
Beta Was this translation helpful? Give feedback.
All reactions