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 | |||
|---|---|---|---|---|---|---|---|---|---|
@paseri/compiler | Code snippet | 0.7.7 | 123 | Precompiled | All errors | 3 μs | |||
typia | Code snippet(Commented code is not benchmarked) | 14.0.0 | n/a | Precompiled | All errors | 20 μs | 6.3x | ||
zod-compiler (compact) | Code snippet | 1.27.0 | n/a | Precompiled | All errors | 61 μs | 18.97x | ||
zod-compiler | Code snippet | 1.27.0 | n/a | Precompiled | All errors | 67 μs | 20.84x | ||
zod-compiler (bag) | Code snippet | 1.27.0 | n/a | Precompiled | All errors | 67 μs | 20.89x | ||