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.
| Library | Version | /wk | Optimizations | Error type | Mean | Compare | |||
|---|---|---|---|---|---|---|---|---|---|
@paseri/compiler | Code snippet | 0.7.7 | 1.03K | Precompiled | All errors | 3 μs | |||
ata-validator | Code snippet | 1.51.0 | 5.24K | JIT | All errors | 3 μs | 1.08x | ||
sury | Code snippet | 11.0.0 | 486.22K | JIT | All errors | 4 μs | 1.27x | ||
joi | Code snippet | 18.2.9 | 25.94M | None | All errors | 4 μs | 1.34x | ||
@paseri/paseri | Code snippet | 1.9.7 | 1.04K | None | All errors | 6 μs | 1.76x | ||
zod-compiler (bag) | Code snippet | 2.0.7 | 64.09K | Precompiled | All errors | 6 μs | 1.93x | ||
zod-compiler | Code snippet | 2.0.7 | 64.09K | Precompiled | All errors | 6 μs | 1.94x | ||
valibot | Code snippet | 1.5.0 | n/a | None | All errors | 11 μs | 3.43x | ||
@remix-run/data-schema | Code snippet | 1.0.0 | n/a | None | All errors | 13 μs | 4.02x | ||
zod | Code snippet | 4.6.5 | 346.1M | JIT | All errors | 15 μs | 4.58x | ||
zod (compile) | Code snippet(Setup code is not benchmarked) | 4.6.5 | 346.1M | JIT | All errors | 15 μs | 4.65x | ||
typia | Code snippet(Setup code is not benchmarked) | 15.1.0 | n/a | Precompiled | All errors | 20 μs | 6.34x | ||
zod/mini | Code snippet | 4.6.5 | 346.1M | JIT | All errors | 21 μs | 6.59x | ||
zod/mini (compile) | Code snippet(Setup code is not benchmarked) | 4.6.5 | 346.1M | JIT | All errors | 21 μs | 6.62x | ||
@railway-ts/pipelines | Code snippet | 0.1.29 | 94 | None | All errors | 21 μs | 6.74x | ||
zod-compiler (compact) | Code snippet | 2.0.7 | 64.09K | Precompiled | All errors | 21 μs | 6.75x | ||
effect | Code snippet(Setup code is not benchmarked) | 4.0.2 | n/a | None | All errors | 22 μs | 7.04x | ||
effect | Code snippet(Setup code is not benchmarked) | 4.0.2 | n/a | None | Abort early | 23 μs | 7.14x | ||
zod/v3 | Code snippet | 4.6.5 | 346.1M | None | All errors | 27 μs | 8.61x | ||
decoders | Code snippet | 2.12.2 | 35.43K | None | All errors | 96 μs | 30.19x | ||
arktype | Code snippet | 2.2.8 | n/a | JIT | All errors | 100 μs | 31.36x | ||
yup | Code snippet | 1.7.1 | 12.82M | None | All errors | 416 μs | 130.94x | ||