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 | ||||
|---|---|---|---|---|---|---|---|---|---|---|
joi | Code snippet | 18.2.1 | 22.51M | None | All errors | 5 μs | ||||
effect | Code snippet(Commented code is not benchmarked) | 3.21.3 | 18.38M | None | Abort early | 5 μs | 1.15x | |||
sury | Code snippet | 11.0.0-alpha.7 | 190.79K | JIT | All errors | 8 μs | 1.69x | |||
typia | Code snippet(Commented code is not benchmarked) | 12.1.1 | 321.84K | Precompiled | All errors | 11 μs | 2.49x | |||
valibot | Code snippet | 1.4.1 | 12.21M | None | All errors | 29 μs | 6.35x | |||
@railway-ts/pipelines | Code snippet | 0.1.29 | 105 | None | All errors | 30 μs | 6.72x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.78 | 18.38M | None | Abort early | 30 μs | 6.74x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.78 | 18.38M | None | All errors | 31 μs | 6.77x | |||
zod/v3 | Code snippet | 4.4.3 | 193.66M | None | All errors | 34 μs | 7.49x | |||
ata-validator | Code snippet | 0.21.0 | 499 | JIT | All errors | 42 μs | 9.35x | |||
zod/mini | Code snippet | 4.4.3 | 193.66M | JIT | All errors | 58 μs | 12.75x | |||
zod | Code snippet | 4.4.3 | 193.66M | JIT | All errors | 59 μs | 13.01x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.21.3 | 18.38M | None | All errors | 72 μs | 15.96x | |||
decoders | Code snippet | 2.9.3 | 65.91K | None | All errors | 103 μs | 22.86x | |||
arktype | Code snippet | 2.2.0 | 1.15M | JIT | All errors | 105 μs | 23.24x | |||
yup | Code snippet | 1.7.1 | 12.33M | None | All errors | 516 μs | 114.17x | |||