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 | |||
|---|---|---|---|---|---|---|---|---|---|
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 24.3M | None | Abort early | 5 μs | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.101 | 24.3M | None | Abort early | 32 μs | 6.66x | ||