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 | /wk | Optimizations | Error type | Mean | Compare | |||
|---|---|---|---|---|---|---|---|---|---|
yup | Code snippet | 1.7.1 | 12.78M | None | All errors | 602 μs | |||
arktype | Code snippet | 2.2.3 | 1.81M | JIT | All errors | 90 μs | 6.67x | ||
decoders | Code snippet | 2.9.3 | 31.47K | None | All errors | 71 μs | 8.52x | ||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 31.53M | None | All errors | 68 μs | 8.92x | ||
zod-compiler (bag) | Code snippet | 1.28.0 | 86.63K | Precompiled | All errors | 61 μs | 9.83x | ||
zod-compiler | Code snippet | 1.28.0 | 86.63K | Precompiled | All errors | 60 μs | 10.04x | ||
zod/mini | Code snippet | 4.4.3 | 272.03M | JIT | All errors | 59 μs | 10.27x | ||
zod | Code snippet | 4.4.3 | 272.03M | JIT | All errors | 56 μs | 10.8x | ||
zod-compiler (compact) | Code snippet | 1.28.0 | 86.63K | Precompiled | All errors | 56 μs | 10.84x | ||
zod/v3 | Code snippet | 4.4.3 | 272.03M | None | All errors | 35 μs | 17.03x | ||
@railway-ts/pipelines | Code snippet | 0.1.29 | 287 | None | All errors | 31 μs | 19.74x | ||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.101 | 31.53M | None | Abort early | 30 μs | 19.75x | ||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.101 | 31.53M | None | All errors | 30 μs | 19.8x | ||
valibot | Code snippet | 1.4.2 | 18.08M | None | All errors | 30 μs | 20.31x | ||
typia | Code snippet(Commented code is not benchmarked) | 14.0.2 | 338.21K | Precompiled | All errors | 20 μs | 29.85x | ||
sury | Code snippet | 11.0.0-rc.2 | 342.48K | JIT | All errors | 9 μs | 67.2x | ||
@paseri/paseri | Code snippet | 1.9.7 | 144 | None | All errors | 6 μs | 101.34x | ||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 31.53M | None | Abort early | 5 μs | 122.82x | ||
joi | Code snippet | 18.2.5 | 25.86M | None | All errors | 5 μs | 125.48x | ||
@paseri/compiler | Code snippet | 0.7.7 | 141 | Precompiled | All errors | 4 μs | 167.85x | ||
ata-validator | Code snippet | 1.7.2 | 2.33K | JIT | All errors | 2 μs | 397.34x | ||