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 | |||
|---|---|---|---|---|---|---|---|---|---|
@paseri/compiler | Code snippet | 0.7.7 | 123 | Precompiled | All errors | 3 μs | |||
@paseri/paseri | Code snippet | 1.9.7 | 172 | None | All errors | 6 μs | 1.76x | ||
@railway-ts/pipelines | Code snippet | 0.1.29 | 123 | None | All errors | 31 μs | 9.75x | ||
arktype | Code snippet | 2.2.3 | 1.4M | JIT | All errors | 97 μs | 30.1x | ||
ata-validator | Code snippet | 1.6.1 | 1.06K | JIT | All errors | 2 μs | 2.1x | ||
decoders | Code snippet | 2.9.3 | 24.27K | None | All errors | 68 μs | 21.08x | ||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 24.3M | None | Abort early | 5 μs | 1.48x | ||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 24.3M | None | All errors | 69 μs | 21.48x | ||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.101 | 24.3M | None | Abort early | 32 μs | 9.85x | ||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.101 | 24.3M | None | All errors | 32 μs | 9.9x | ||
joi | Code snippet | 18.2.3 | 20.46M | None | All errors | 4 μs | 1.38x | ||
sury | Code snippet | 11.0.0-rc.1 | 240.68K | JIT | All errors | 9 μs | 2.82x | ||
typia | Code snippet(Commented code is not benchmarked) | 14.0.0 | 271.05K | Precompiled | All errors | 20 μs | 6.3x | ||
valibot | Code snippet | 1.4.2 | 14.88M | None | All errors | 29 μs | 9.11x | ||
yup | Code snippet | 1.7.1 | 10.52M | None | All errors | 634 μs | 196.81x | ||
zod | Code snippet | 4.4.3 | 223.55M | JIT | All errors | 66 μs | 20.44x | ||
zod-compiler | Code snippet | 1.27.0 | 31.11K | Precompiled | All errors | 67 μs | 20.84x | ||
zod-compiler (bag) | Code snippet | 1.27.0 | 31.11K | Precompiled | All errors | 67 μs | 20.89x | ||
zod-compiler (compact) | Code snippet | 1.27.0 | 31.11K | Precompiled | All errors | 61 μs | 18.97x | ||
zod/mini | Code snippet | 4.4.3 | 223.55M | JIT | All errors | 66 μs | 20.56x | ||
zod/v3 | Code snippet | 4.4.3 | 223.55M | None | All errors | 37 μs | 11.44x | ||