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 | Downloads (/wk) | Optimizations | Error type | Mean | Compare | ||||
|---|---|---|---|---|---|---|---|---|---|---|
joi | Code snippet | 18.1.2 | 18.77M | None | All errors | 4 μs | ||||
effect | Code snippet(Commented code is not benchmarked) | 3.21.0 | 9.54M | None | Abort early | 5 μs | 1.07x | |||
sury | Code snippet | 11.0.0-alpha.4 | 152.1K | JIT | All errors | 8 μs | 1.82x | |||
ata-validator | Code snippet | 0.9.3 | 923 | JIT | All errors | 9 μs | 2.07x | |||
typia | Code snippet(Commented code is not benchmarked) | 12.0.2 | 256.82K | Precompiled | All errors | 10 μs | 2.35x | |||
valibot | Code snippet | 1.3.1 | 8.04M | None | All errors | 28 μs | 6.29x | |||
@railway-ts/pipelines | Code snippet | 0.1.27 | 28 | None | All errors | 30 μs | 6.84x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.49 | 9.54M | None | Abort early | 31 μs | 6.9x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.49 | 9.54M | None | All errors | 31 μs | 6.91x | |||
zod/v3 | Code snippet | 4.3.6 | 154.06M | None | All errors | 35 μs | 7.82x | |||
decoders | Code snippet | 2.9.3 | 36.8K | None | All errors | 71 μs | 15.92x | |||
zod/mini | Code snippet | 4.3.6 | 154.06M | JIT | All errors | 71 μs | 15.94x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.21.0 | 9.54M | None | All errors | 72 μs | 16.06x | |||
zod | Code snippet | 4.3.6 | 154.06M | JIT | All errors | 74 μs | 16.55x | |||
arktype | Code snippet | 2.2.0 | 892.31K | JIT | All errors | 98 μs | 21.89x | |||
yup | Code snippet | 1.7.1 | 10.83M | None | All errors | 555 μs | 124.68x | |||