News for hackers. Stuff that matters.
Re:Zod: TypeScript-first schema validation with static type ... by crooked-v on Wednesday October 09, 2024 @01:25PM (#41790398)
Valibot also has much, much more efficient type inference, which sounds unimportant right up until you have 50 schemas referencing each other and all your Typescript stuff slows to a molasses crawl.
Re:Zod: TypeScript-first schema validation with static type ... by zztop44 on Wednesday October 09, 2024 @05:14PM (#41792711)
Agreed. I recently moved a production app from Zod to Valibot for exactly this reason. I still slightly prefer Zod’s syntax but the performance issues were absolutely killing us.
Re:Zod: TypeScript-first schema validation with static type ... by Escapado on Thursday October 10, 2024 @04:46AM (#41796900)
Not only that, runtime schema validation was also way faster in my last project for larger arrays of complex objects with lots of union types. Went from 400ms to 24ms all else being equal. Since our validation was running on every request for certain reasons this made a huge difference in perceived performance for our users and less load on our servers.