Parsing a value to match the schema. This is different to validation because it returns a new value.
Copy to clipboardimport * as v from "valibot"; import { personSchema } from "./schemas"; const person = v.parse(personSchema, data); // person is of type Person
| Library | Version | Downloads (/wk) | Optimizations | Error type | Mean | Compare | ||||
|---|---|---|---|---|---|---|---|---|---|---|
@railway-ts/pipelines | Code snippet | 0.1.27 | 364 | None | Abort early | 655 ns | ||||
valibot | Code snippet | 1.3.1 | 8.61M | None | Abort early | 742 ns | 1.13x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.35 | 11.72M | None | Abort early | 1 μs | 1.71x | |||
joi | Code snippet | 18.0.2 | 18.91M | None | Abort early | 4 μs | 6.03x | |||
io-ts | Code snippet | 2.2.22 | 2.92M | None | All errors | 6 μs | 8.88x | |||
typia (createValidate) | Code snippet(Commented code is not benchmarked) | 12.0.1 | 261.03K | Precompiled | All errors | 6 μs | 9.9x | |||
typia (validate) | Code snippet | 12.0.1 | 261.03K | Precompiled | All errors | 7 μs | 10.53x | |||
sury (compile) | Code snippet(Commented code is not benchmarked) | Throws on invalid dataThis library throws an error when parsing invalid data (and has no non-throwing equivalent), so the benchmark includes a try/catch. | 11.0.0-alpha.4 | 158.32K | JIT | All errors | 8 μs | 11.89x | ||
sury (compile + safe) | Code snippet(Commented code is not benchmarked) | 11.0.0-alpha.4 | 158.32K | JIT | All errors | 8 μs | 12.35x | |||
sury (safe) | Code snippet | 11.0.0-alpha.4 | 158.32K | JIT | All errors | 8 μs | 12.8x | |||
sury | Code snippet | Throws on invalid dataThis library throws an error when parsing invalid data (and has no non-throwing equivalent), so the benchmark includes a try/catch. | 11.0.0-alpha.4 | 158.32K | JIT | All errors | 8 μs | 12.82x | ||
effect | Code snippet(Commented code is not benchmarked) | 3.20.0 | 11.72M | None | Abort early | 9 μs | 14.33x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.35 | 11.72M | None | All errors | 20 μs | 30.8x | |||
valibot | Code snippet | 1.3.1 | 8.61M | None | All errors | 29 μs | 43.62x | |||
valibot (abortPipeEarly only) | Code snippet | 1.3.1 | 8.61M | None | Abort early | 29 μs | 44.09x | |||
@railway-ts/pipelines | Code snippet | 0.1.27 | 364 | None | All errors | 31 μs | 47.14x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.20.0 | 11.72M | None | All errors | 31 μs | 47.62x | |||
zod/v3 | Code snippet | 4.3.6 | 160.8M | None | All errors | 40 μs | 61.1x | |||
joi | Code snippet | 18.0.2 | 18.91M | None | All errors | 60 μs | 90.84x | |||
typebox (schema compile) | Code snippet(Commented code is not benchmarked) | Throws on invalid dataThis library throws an error when parsing invalid data (and has no non-throwing equivalent), so the benchmark includes a try/catch. | 1.1.6 | 281.23K | JIT | All errors | 71 μs | 108.95x | ||
zod/mini (jitless) | Code snippet | 4.3.6 | 160.8M | None | All errors | 74 μs | 112.52x | |||
zod/mini | Code snippet | 4.3.6 | 160.8M | JIT | All errors | 74 μs | 113.55x | |||
typebox (schema) | Code snippet | Throws on invalid dataThis library throws an error when parsing invalid data (and has no non-throwing equivalent), so the benchmark includes a try/catch. | 1.1.6 | 281.23K | JIT | All errors | 75 μs | 114.68x | ||
decoders | Code snippet | 2.9.1 | 37.21K | None | All errors | 78 μs | 119.25x | |||
typebox (compile) | Code snippet(Commented code is not benchmarked) | Throws on invalid dataThis library throws an error when parsing invalid data (and has no non-throwing equivalent), so the benchmark includes a try/catch. | 1.1.6 | 281.23K | JIT | All errors | 80 μs | 121.98x | ||
typebox | Code snippet | Throws on invalid dataThis library throws an error when parsing invalid data (and has no non-throwing equivalent), so the benchmark includes a try/catch. | 1.1.6 | 281.23K | JIT | All errors | 85 μs | 130.22x | ||
zod | Code snippet | 4.3.6 | 160.8M | JIT | All errors | 87 μs | 132.29x | |||
zod (jitless) | Code snippet | 4.3.6 | 160.8M | None | All errors | 92 μs | 140.26x | |||
yup | Code snippet | Throws on invalid dataThis library throws an error when parsing invalid data (and has no non-throwing equivalent), so the benchmark includes a try/catch. | 1.7.1 | 10.63M | None | Abort early | 95 μs | 145.31x | ||
arktype | Code snippet | 2.2.0 | 814.62K | JIT | All errors | 96 μs | 146.87x | |||
yup | Code snippet | Throws on invalid dataThis library throws an error when parsing invalid data (and has no non-throwing equivalent), so the benchmark includes a try/catch. | 1.7.1 | 10.63M | None | All errors | 537 μs | 819.38x | ||