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.0.2 | 18.91M | None | All errors | 4 μs | ||||
effect | Code snippet(Commented code is not benchmarked) | 3.20.0 | 11.72M | None | Abort early | 5 μs | 1.1x | |||
sury | Code snippet | 11.0.0-alpha.4 | 158.32K | JIT | All errors | 8 μs | 1.87x | |||
typia | Code snippet(Commented code is not benchmarked) | 12.0.1 | 261.03K | Precompiled | All errors | 11 μs | 2.41x | |||
valibot | Code snippet | 1.3.1 | 8.61M | None | All errors | 29 μs | 6.44x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.35 | 11.72M | None | Abort early | 30 μs | 6.84x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.35 | 11.72M | None | All errors | 30 μs | 6.85x | |||
@railway-ts/pipelines | Code snippet | 0.1.27 | 364 | None | All errors | 31 μs | 7.03x | |||
zod/v3 | Code snippet | 4.3.6 | 160.8M | None | All errors | 35 μs | 7.85x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.20.0 | 11.72M | None | All errors | 73 μs | 16.53x | |||
zod/mini | Code snippet | 4.3.6 | 160.8M | JIT | All errors | 73 μs | 16.54x | |||
zod | Code snippet | 4.3.6 | 160.8M | JIT | All errors | 75 μs | 16.83x | |||
arktype | Code snippet | 2.2.0 | 814.62K | JIT | All errors | 95 μs | 21.49x | |||
decoders | Code snippet | 2.9.1 | 37.21K | None | All errors | 100 μs | 22.51x | |||
yup | Code snippet | 1.7.1 | 10.63M | None | All errors | 563 μs | 126.96x | |||