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.3 | 17.8M | None | All errors | 5 μs | ||||
effect | Code snippet(Commented code is not benchmarked) | 3.21.4 | 18.87M | None | Abort early | 5 μs | 1.07x | |||
sury | Code snippet | 11.0.0-alpha.8 | 218.09K | JIT | All errors | 9 μs | 1.84x | |||
typia | Code snippet(Commented code is not benchmarked) | 12.1.1 | 313.14K | Precompiled | All errors | 10 μs | 2.17x | |||
valibot | Code snippet | 1.4.1 | 14.25M | None | All errors | 29 μs | 6.25x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.84 | 18.87M | None | Abort early | 29 μs | 6.29x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.84 | 18.87M | None | All errors | 29 μs | 6.3x | |||
@railway-ts/pipelines | Code snippet | 0.1.29 | 29 | None | All errors | 31 μs | 6.77x | |||
zod/v3 | Code snippet | 4.4.3 | 224.11M | None | All errors | 35 μs | 7.58x | |||
ata-validator | Code snippet | 0.21.0 | 411 | JIT | All errors | 42 μs | 9.02x | |||
zod | Code snippet | 4.4.3 | 224.11M | JIT | All errors | 56 μs | 12.09x | |||
zod/mini | Code snippet | 4.4.3 | 224.11M | JIT | All errors | 58 μs | 12.62x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.21.4 | 18.87M | None | All errors | 66 μs | 14.28x | |||
decoders | Code snippet | 2.9.3 | 50.3K | None | All errors | 76 μs | 16.33x | |||
arktype | Code snippet | 2.2.1 | 1.19M | JIT | All errors | 90 μs | 19.41x | |||
yup | Code snippet | 1.7.1 | 10.11M | None | All errors | 572 μs | 123.46x | |||