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 | 6 μs | 1.2x | |||
sury | Code snippet | 11.0.0-alpha.7 | 190.79K | JIT | All errors | 8 μs | 1.67x | |||
typia | Code snippet(Commented code is not benchmarked) | 12.1.1 | 321.84K | Precompiled | All errors | 11 μs | 2.27x | |||
valibot | Code snippet | 1.4.1 | 12.21M | None | All errors | 27 μs | 5.83x | |||
@railway-ts/pipelines | Code snippet | 0.1.29 | 105 | None | All errors | 29 μs | 6.22x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.75 | 18.38M | None | Abort early | 29 μs | 6.25x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.75 | 18.38M | None | All errors | 29 μs | 6.27x | |||
zod/v3 | Code snippet | 4.4.3 | 193.66M | None | All errors | 32 μs | 6.99x | |||
ata-validator | Code snippet | 0.21.0 | 499 | JIT | All errors | 43 μs | 9.37x | |||
zod | Code snippet | 4.4.3 | 193.66M | JIT | All errors | 54 μs | 11.65x | |||
zod/mini | Code snippet | 4.4.3 | 193.66M | JIT | All errors | 57 μs | 12.27x | |||
decoders | Code snippet | 2.9.3 | 65.91K | None | All errors | 76 μs | 16.48x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.21.2 | 18.38M | None | All errors | 83 μs | 17.85x | |||
arktype | Code snippet | 2.2.0 | 1.15M | JIT | All errors | 88 μs | 19.06x | |||
yup | Code snippet | 1.7.1 | 12.33M | None | All errors | 496 μs | 106.89x | |||