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.1.2 | 18.77M | None | All errors | 5 μs | ||||
effect | Code snippet(Commented code is not benchmarked) | 3.21.0 | 9.54M | None | Abort early | 5 μs | 1.14x | |||
sury | Code snippet | 11.0.0-alpha.4 | 152.1K | JIT | All errors | 8 μs | 1.72x | |||
ata-validator | Code snippet | 0.8.0 | 923 | JIT | All errors | 8 μs | 1.84x | |||
typia | Code snippet(Commented code is not benchmarked) | 12.0.2 | 256.82K | Precompiled | All errors | 10 μs | 2.27x | |||
valibot | Code snippet | 1.3.1 | 8.04M | None | All errors | 27 μs | 5.92x | |||
@railway-ts/pipelines | Code snippet | 0.1.27 | 34 | None | All errors | 29 μs | 6.43x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.46 | 9.54M | None | Abort early | 30 μs | 6.63x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.46 | 9.54M | None | All errors | 30 μs | 6.66x | |||
zod/v3 | Code snippet | 4.3.6 | 151.14M | None | All errors | 33 μs | 7.14x | |||
zod | Code snippet | 4.3.6 | 151.14M | JIT | All errors | 63 μs | 13.75x | |||
zod/mini | Code snippet | 4.3.6 | 151.14M | JIT | All errors | 64 μs | 13.94x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.21.0 | 9.54M | None | All errors | 71 μs | 15.44x | |||
arktype | Code snippet | 2.2.0 | 892.31K | JIT | All errors | 89 μs | 19.53x | |||
decoders | Code snippet | 2.9.3 | 36.8K | None | All errors | 94 μs | 20.56x | |||
yup | Code snippet | 1.7.1 | 10.83M | None | All errors | 497 μs | 108.85x | |||