Many libraries implement the Standard Schema interface, which allows many other libraries to accept them without needing to specialise for each library.
Copy to clipboardimport { personSchema } from "./schemas"; const person = await upfetch(url, { schema: personSchema });
We benchmark the time taken to parse using a standard schema.
Info
Some libraries require an adapter before they can be used as a standard schema. The time to convert the schema is not measured, only the time to parse using it.
| Library | Version | Downloads (/wk) | Optimizations | Error type | Mean | Compare | ||||
|---|---|---|---|---|---|---|---|---|---|---|
zod | Code snippet | 4.4.1 | 163.46M | JIT | All errors | 65 μs | ||||
zod/mini | Code snippet | 4.4.1 | 163.46M | JIT | All errors | 67 μs | 1.03x | |||
zod/v3 | Code snippet | 4.4.1 | 163.46M | None | All errors | 35 μs | 1.88x | |||
joi | Code snippet | 18.1.2 | 19.41M | None | All errors | 5 μs | 14.08x | |||
effect | Code snippet | 3.21.2 | 12.89M | None | Abort early | 5 μs | 12.85x | |||
effect | Code snippet | 3.21.2 | 12.89M | None | All errors | 74 μs | 1.14x | |||
effect@beta | Code snippet | 4.0.0-beta.59 | 12.89M | None | All errors | 30 μs | 2.16x | |||
effect@beta | Code snippet | 4.0.0-beta.59 | 12.89M | None | Abort early | 31 μs | 2.11x | |||
yup | Code snippet | 1.7.1 | 10.89M | None | All errors | 561 μs | 8.61x | |||
valibot | Code snippet | 1.3.1 | 9.37M | None | All errors | 29 μs | 2.23x | |||
arktype | Code snippet | 2.2.0 | 833.25K | JIT | All errors | 97 μs | 1.48x | |||
typia | Code snippet | 12.0.2 | 291.57K | Precompiled | All errors | 11 μs | 5.87x | |||
sury | Code snippet | 11.0.0-alpha.4 | 180.31K | JIT | All errors | 8 μs | 8.02x | |||
decoders | Code snippet | 2.9.3 | 44.56K | None | All errors | 92 μs | 1.4x | |||
ata-validator | Code snippet | 0.12.1 | 748 | JIT | All errors | 9 μs | 7.14x | |||
@railway-ts/pipelines | Code snippet | 0.1.29 | 98 | None | All errors | 31 μs | 2.09x | |||