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, });
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.
Optimizations
Abort early
| Library | Version | /wk | Optimizations | Error type | Mean | Compare | |||
|---|---|---|---|---|---|---|---|---|---|
@paseri/compiler | Code snippet | 0.7.7 | 687 | Precompiled | All errors | 3 μs | |||
ata-validator | Code snippet | 1.58.0 | n/a | JIT | All errors | 3 μs | 1x | ||
sury | Code snippet | 11.0.0 | 269.13K | JIT | All errors | 4 μs | 1.23x | ||
joi | Code snippet | 18.3.0 | 15.74M | None | All errors | 4 μs | 1.29x | ||
@paseri/paseri | Code snippet | 1.9.7 | 750 | None | All errors | 6 μs | 1.73x | ||
zod-compiler (bag) | Code snippet | 2.0.7 | 40.31K | Precompiled | All errors | 6 μs | 1.83x | ||
zod-compiler | Code snippet | 2.0.7 | 40.31K | Precompiled | All errors | 6 μs | 1.89x | ||
valibot | Code snippet | 1.5.0 | 14.44M | None | All errors | 11 μs | 3.3x | ||
@remix-run/data-schema | Code snippet | 1.0.0 | 32.3K | None | All errors | 13 μs | 3.86x | ||
zod | Code snippet | 4.6.7 | 207.05M | JIT | All errors | 15 μs | 4.37x | ||
zod (compile) | Code snippet(Setup code is not benchmarked) | 4.6.7 | 207.05M | JIT | All errors | 15 μs | 4.47x | ||
typia | Code snippet(Setup code is not benchmarked) | 15.1.0 | 211.41K | Precompiled | All errors | 19 μs | 5.71x | ||
zod/mini | Code snippet | 4.6.7 | 207.05M | JIT | All errors | 22 μs | 6.49x | ||
@railway-ts/pipelines | Code snippet | 0.1.29 | 14 | None | All errors | 22 μs | 6.53x | ||
zod/mini (compile) | Code snippet(Setup code is not benchmarked) | 4.6.7 | 207.05M | JIT | All errors | 22 μs | 6.55x | ||
effect | Code snippet(Setup code is not benchmarked) | 4.0.5 | 31.55M | None | Abort early | 23 μs | 6.72x | ||
effect | Code snippet(Setup code is not benchmarked) | 4.0.5 | 31.55M | None | All errors | 23 μs | 6.83x | ||
zod-compiler (compact) | Code snippet | 2.0.7 | 40.31K | Precompiled | All errors | 23 μs | 6.91x | ||
zod/v3 | Code snippet | 4.6.7 | 207.05M | None | All errors | 27 μs | 8.15x | ||
arktype | Code snippet | 2.2.9 | 1.45M | JIT | All errors | 100 μs | 29.72x | ||
decoders | Code snippet | 2.13.0 | n/a | None | All errors | 102 μs | 30.5x | ||
yup | Code snippet | 1.7.1 | 7.45M | None | All errors | 414 μs | 123.55x | ||