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 | 10.52M | None | All errors | 634 μs | |||
arktype | Code snippet | 2.2.3 | 1.4M | JIT | All errors | 97 μs | 6.54x | ||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 24.3M | None | All errors | 69 μs | 9.16x | ||
decoders | Code snippet | 2.9.3 | 24.27K | None | All errors | 68 μs | 9.34x | ||
zod-compiler (bag) | Code snippet | 1.27.0 | 31.11K | Precompiled | All errors | 67 μs | 9.42x | ||
zod-compiler | Code snippet | 1.27.0 | 31.11K | Precompiled | All errors | 67 μs | 9.44x | ||
zod/mini | Code snippet | 4.4.3 | 223.55M | JIT | All errors | 66 μs | 9.57x | ||
zod | Code snippet | 4.4.3 | 223.55M | JIT | All errors | 66 μs | 9.63x | ||
zod-compiler (compact) | Code snippet | 1.27.0 | 31.11K | Precompiled | All errors | 61 μs | 10.37x | ||
zod/v3 | Code snippet | 4.4.3 | 223.55M | None | All errors | 37 μs | 17.2x | ||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.101 | 24.3M | None | All errors | 32 μs | 19.88x | ||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.101 | 24.3M | None | Abort early | 32 μs | 19.98x | ||
@railway-ts/pipelines | Code snippet | 0.1.29 | 123 | None | All errors | 31 μs | 20.18x | ||
valibot | Code snippet | 1.4.2 | 14.88M | None | All errors | 29 μs | 21.6x | ||
typia | Code snippet(Commented code is not benchmarked) | 14.0.0 | 271.05K | Precompiled | All errors | 20 μs | 31.26x | ||
sury | Code snippet | 11.0.0-rc.1 | 240.68K | JIT | All errors | 9 μs | 69.89x | ||
@paseri/paseri | Code snippet | 1.9.7 | 172 | None | All errors | 6 μs | 111.67x | ||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 24.3M | None | Abort early | 5 μs | 133.03x | ||
joi | Code snippet | 18.2.3 | 20.46M | None | All errors | 4 μs | 143.14x | ||
@paseri/compiler | Code snippet | 0.7.7 | 123 | Precompiled | All errors | 3 μs | 196.81x | ||
ata-validator | Code snippet | 1.6.1 | 1.06K | JIT | All errors | 2 μs | 414.27x | ||