3 ms·
Zod 4 looks good but even with their latest improvements, ArkType is still an order of magnitude faster. Sometimes for the sake of backward and syntax compatibi
by satvikpendem 1y ago
Zod 4 looks good but even with their latest improvements, ArkType is still an order of magnitude faster. Sometimes for the sake of backward and syntax compatibility, it is difficult to make something much faster than a fully greenfield newer library. We recently did an analysis of all these types of tools for our project and decided to go with ArkType for partially this reason, the other was TypeScript ergonomics felt nicer.
- dangoodmanUT 1y agoArkType is a nightmare to use, zod is nice to use
- lhnz 1y agoOut of interest, why is it a nightmare to use? I've always been worried about how overly clever the approach is, does it have problems?
- atonse 1y agoI was looking at all their speed metrics, and can you explain to me where the speed makes a difference? We only use zod to validate forms, so I keep thinking "how does this matter?" Are people maybe using it to validate high throughput API input messages or something like that, where performance may matter more?
- satvikpendem 1y agoYes, we use it to validate the API responses from the backend (as well as type validation on the backend itself from any frontend POST requests), and especially on the client side, speed and bundle size is very important.
- yhprum 1y agoDoes arktype not come with a larger bundle size than zod? That was the reason I was shying away from it at the moment, especially with the bundle size reductions with zod 4 as well [1] https://www.reddit.com/r/typescript/comments/1i3ogwi/announcing_arktype_20_validate_100x_faster_with/m7pdcdy/ https://www.reddit.com/r/typescript/comments/1i3ogwi/announc...
- vlovich123 1y agoYeah, I can't see zod really adding that much overhead in the critical latency path for all but extremely large responses. Sometimes people pick "the fastest" library without considering whether the performance is relevant for a given code path.
- andrewflnr 1y agoInteresting, that one didn't even appear in my research. I was specifically looking for typescript ergonomics too. Probably still not going to switch away from Zod, though.
- sroussey 1y agoWhy ArkType over TypeBox?