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.29 | 131 | None | Abort early | 624 ns | ||||
ata-validator | Code snippet | 1.2.2 | 979 | JIT | All errors | 653 ns | 1.05x | |||
valibot | Code snippet | 1.4.2 | 15.65M | None | Abort early | 707 ns | 1.13x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.101 | 26.02M | None | Abort early | 1 μs | 2.09x | |||
@paseri/compiler (safeParse) | Code snippet | 0.7.7 | 104 | Precompiled | All errors | 1 μs | 2.28x | |||
@paseri/paseri (safeParse) | Code snippet | 1.9.7 | 108 | None | All errors | 4 μs | 6.18x | |||
joi | Code snippet | 18.2.3 | 23.69M | None | Abort early | 4 μs | 6.56x | |||
io-ts | Code snippet | 2.2.22 | 2.71M | None | All errors | 6 μs | 9.77x | |||
sury | 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.11 | 291.77K | JIT | All errors | 7 μs | 11.28x | ||
sury (safe) | Code snippet | 11.0.0-alpha.11 | 291.77K | JIT | All errors | 7 μs | 11.53x | |||
@paseri/compiler (parse) | 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. | 0.7.7 | 104 | Precompiled | All errors | 7 μs | 11.76x | ||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 26.02M | None | Abort early | 9 μs | 14.4x | |||
@paseri/paseri (parse) | 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.9.7 | 108 | None | All errors | 10 μs | 15.61x | ||
superstruct | Code snippet | 2.0.2 | 5.65M | None | Abort early | 10 μs | 16.35x | |||
superstruct (schema.validate) | Code snippet | 2.0.2 | 5.65M | None | Abort early | 11 μs | 17.21x | |||
typia (createValidate) | Code snippet(Commented code is not benchmarked) | 13.2.0 | 322.95K | Precompiled | All errors | 17 μs | 26.82x | |||
typia (validate) | Code snippet | 13.2.0 | 322.95K | Precompiled | All errors | 18 μs | 28.21x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.101 | 26.02M | None | All errors | 22 μs | 34.86x | |||
valibot (abortPipeEarly only) | Code snippet | 1.4.2 | 15.65M | None | Abort early | 27 μs | 43.36x | |||
valibot | Code snippet | 1.4.2 | 15.65M | None | All errors | 27 μs | 43.96x | |||
@railway-ts/pipelines | Code snippet | 0.1.29 | 131 | None | All errors | 29 μs | 46.65x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 26.02M | None | All errors | 30 μs | 47.29x | |||
zod/v3 | Code snippet | 4.4.3 | 240.5M | None | All errors | 37 μs | 59.03x | |||
joi | Code snippet | 18.2.3 | 23.69M | None | All errors | 56 μs | 89.64x | |||
zod/mini (jitless) | Code snippet | 4.4.3 | 240.5M | None | All errors | 58 μs | 92.26x | |||
zod/mini | Code snippet | 4.4.3 | 240.5M | JIT | All errors | 58 μs | 92.49x | |||
zod | Code snippet | 4.4.3 | 240.5M | JIT | All errors | 63 μs | 101.64x | |||
decoders | Code snippet | 2.9.3 | 54.62K | None | All errors | 65 μs | 103.61x | |||
zod (jitless) | Code snippet | 4.4.3 | 240.5M | None | All errors | 68 μs | 109.59x | |||
superstruct | Code snippet | 2.0.2 | 5.65M | None | All errors | 74 μs | 118.44x | |||
superstruct | Code snippet | 2.0.2 | 5.65M | None | All errors | 75 μs | 120.88x | |||
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.3.8 | n/a | JIT | All errors | 77 μs | 123.81x | ||
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.3.8 | n/a | JIT | All errors | 82 μs | 131.24x | ||
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 | n/a | None | Abort early | 84 μs | 134.08x | ||
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.3.8 | n/a | JIT | All errors | 84 μs | 134.81x | ||
typebox (script 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.3.8 | n/a | JIT | All errors | 87 μs | 139.59x | ||
arktype | Code snippet | 2.2.3 | n/a | JIT | All errors | 89 μs | 143.34x | |||
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.3.8 | n/a | JIT | All errors | 91 μs | 145.58x | ||
runtypes | Code snippet | 7.0.4 | n/a | None | Abort early | 170 μs | 273.03x | |||
runtypes | 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. | 7.0.4 | n/a | None | Abort early | 181 μs | 289.42x | ||
@sapphire/shapeshift | 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. | 4.0.0 | n/a | None | All errors | 265 μs | 424.14x | ||
@sapphire/shapeshift (run) | Code snippet | 4.0.0 | n/a | None | All errors | 266 μs | 426.46x | |||
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 | n/a | None | All errors | 476 μs | 762.92x | ||