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 | 611 ns | ||||
ata-validator | Code snippet | 1.2.2 | 979 | JIT | All errors | 662 ns | 1.08x | |||
valibot | Code snippet | 1.4.2 | 15.65M | None | Abort early | 712 ns | 1.17x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.101 | 26.02M | None | Abort early | 1 μs | 2.13x | |||
@paseri/compiler (safeParse) | Code snippet | 0.7.7 | 104 | Precompiled | All errors | 1 μs | 2.34x | |||
@paseri/paseri (safeParse) | Code snippet | 1.9.7 | 108 | None | All errors | 4 μs | 6.3x | |||
joi | Code snippet | 18.2.3 | 23.69M | None | Abort early | 4 μs | 6.65x | |||
io-ts | Code snippet | 2.2.22 | 2.71M | None | All errors | 6 μs | 9.79x | |||
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.38x | ||
sury (safe) | Code snippet | 11.0.0-alpha.11 | 291.77K | JIT | All errors | 7 μs | 11.81x | |||
@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.94x | ||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 26.02M | None | Abort early | 9 μs | 15.39x | |||
@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.88x | ||
superstruct (schema.validate) | Code snippet | 2.0.2 | 5.65M | None | Abort early | 10 μs | 16.6x | |||
superstruct | Code snippet | 2.0.2 | 5.65M | None | Abort early | 10 μs | 17.1x | |||
typia (createValidate) | Code snippet(Commented code is not benchmarked) | 13.2.0 | 322.95K | Precompiled | All errors | 17 μs | 27.66x | |||
typia (validate) | Code snippet | 13.2.0 | 322.95K | Precompiled | All errors | 18 μs | 28.91x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.101 | 26.02M | None | All errors | 21 μs | 35.1x | |||
valibot | Code snippet | 1.4.2 | 15.65M | None | All errors | 28 μs | 45.09x | |||
valibot (abortPipeEarly only) | Code snippet | 1.4.2 | 15.65M | None | Abort early | 28 μs | 45.65x | |||
@railway-ts/pipelines | Code snippet | 0.1.29 | 131 | None | All errors | 28 μs | 46.54x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 26.02M | None | All errors | 30 μs | 49.23x | |||
zod/v3 | Code snippet | 4.4.3 | 240.5M | None | All errors | 36 μs | 59.59x | |||
joi | Code snippet | 18.2.3 | 23.69M | None | All errors | 55 μs | 89.56x | |||
zod/mini (jitless) | Code snippet | 4.4.3 | 240.5M | None | All errors | 57 μs | 92.81x | |||
zod/mini | Code snippet | 4.4.3 | 240.5M | JIT | All errors | 57 μs | 92.87x | |||
zod | Code snippet | 4.4.3 | 240.5M | JIT | All errors | 62 μs | 101.07x | |||
decoders | Code snippet | 2.9.3 | 54.62K | None | All errors | 66 μs | 107.67x | |||
zod (jitless) | Code snippet | 4.4.3 | 240.5M | None | All errors | 68 μs | 111.83x | |||
superstruct | Code snippet | 2.0.2 | 5.65M | None | All errors | 73 μs | 119.85x | |||
superstruct | Code snippet | 2.0.2 | 5.65M | None | All errors | 73 μs | 120.3x | |||
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 | 5.5M | JIT | All errors | 79 μs | 128.54x | ||
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 | 5.5M | JIT | All errors | 82 μs | 133.73x | ||
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 | 12.65M | None | Abort early | 83 μs | 136.39x | ||
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 | 5.5M | JIT | All errors | 86 μs | 140.74x | ||
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 | 5.5M | JIT | All errors | 88 μs | 144.16x | ||
arktype | Code snippet | 2.2.3 | 1.39M | JIT | All errors | 89 μs | 145.58x | |||
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 | 5.5M | JIT | All errors | 92 μs | 151.39x | ||
runtypes | Code snippet | 7.0.4 | 305.32K | None | Abort early | 170 μs | 278.53x | |||
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 | 305.32K | None | Abort early | 180 μs | 294.49x | ||
@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 | 1.06M | None | All errors | 259 μs | 424.55x | ||
@sapphire/shapeshift (run) | Code snippet | 4.0.0 | 1.06M | None | All errors | 261 μs | 427.45x | |||
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 | 12.65M | None | All errors | 481 μs | 786.96x | ||