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.2 | 18.38M | None | Abort early | 5 μs | 1.15x | |||
sury | Code snippet | 11.0.0-alpha.6 | 190.79K | JIT | All errors | 8 μs | 1.61x | |||
typia | Code snippet(Commented code is not benchmarked) | 12.1.1 | 321.84K | Precompiled | All errors | 10 μs | 2.22x | |||
valibot | Code snippet | 1.4.1 | 12.21M | None | All errors | 28 μs | 5.89x | |||
@railway-ts/pipelines | Code snippet | 0.1.29 | 105 | None | All errors | 31 μs | 6.55x | |||
zod/v3 | Code snippet | 4.4.3 | 193.66M | None | All errors | 33 μs | 7.04x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.71 | 18.38M | None | All errors | 40 μs | 8.61x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.71 | 18.38M | None | Abort early | 41 μs | 8.71x | |||
ata-validator | Code snippet | 0.18.2 | 499 | JIT | All errors | 44 μs | 9.37x | |||
zod | Code snippet | 4.4.3 | 193.66M | JIT | All errors | 57 μs | 12.12x | |||
zod/mini | Code snippet | 4.4.3 | 193.66M | JIT | All errors | 58 μs | 12.29x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.21.2 | 18.38M | None | All errors | 71 μs | 15.1x | |||
arktype | Code snippet | 2.2.0 | 1.15M | JIT | All errors | 90 μs | 19.07x | |||
decoders | Code snippet | 2.9.3 | 65.91K | None | All errors | 92 μs | 19.59x | |||
yup | Code snippet | 1.7.1 | 12.33M | None | All errors | 500 μs | 106.3x | |||