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 | 663 ns | ||||
valibot | Code snippet | 1.4.2 | 15.65M | None | Abort early | 726 ns | 1.1x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.101 | 26.02M | None | Abort early | 1 μs | 1.86x | |||
@paseri/compiler (safeParse) | Code snippet | 0.7.7 | 149 | Precompiled | All errors | 2 μs | 2.3x | |||
joi | Code snippet | 18.2.3 | 23.69M | None | Abort early | 4 μs | 6.07x | |||
@paseri/paseri (safeParse) | Code snippet | 1.9.7 | 190 | None | All errors | 4 μs | 6.19x | |||
io-ts | Code snippet | 2.2.22 | 2.71M | None | All errors | 6 μs | 8.87x | |||
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.08x | ||
@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 | 149 | Precompiled | All errors | 8 μs | 11.4x | ||
sury (safe) | Code snippet | 11.0.0-alpha.11 | 291.77K | JIT | All errors | 8 μs | 11.47x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 26.02M | None | Abort early | 9 μs | 14.19x | |||
@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 | 190 | None | All errors | 10 μs | 15.42x | ||
superstruct (schema.validate) | Code snippet | 2.0.2 | 5.65M | None | Abort early | 10 μs | 15.62x | |||
superstruct | Code snippet | 2.0.2 | 5.65M | None | Abort early | 10 μs | 15.63x | |||
typia (createValidate) | Code snippet(Commented code is not benchmarked) | 13.2.0 | 322.95K | Precompiled | All errors | 17 μs | 26.24x | |||
typia (validate) | Code snippet | 13.2.0 | 322.95K | Precompiled | All errors | 18 μs | 27.7x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.101 | 26.02M | None | All errors | 21 μs | 32.25x | |||
valibot (abortPipeEarly only) | Code snippet | 1.4.2 | 15.65M | None | Abort early | 29 μs | 43.54x | |||
valibot | Code snippet | 1.4.2 | 15.65M | None | All errors | 29 μs | 44.22x | |||
@railway-ts/pipelines | Code snippet | 0.1.29 | 131 | None | All errors | 31 μs | 46.67x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 26.02M | None | All errors | 32 μs | 48.08x | |||
zod/v3 | Code snippet | 4.4.3 | 240.5M | None | All errors | 41 μs | 61.34x | |||
ata-validator | Code snippet | 1.2.1 | 979 | JIT | All errors | 56 μs | 85.09x | |||
decoders | Code snippet | 2.9.3 | 54.62K | None | All errors | 60 μs | 90.16x | |||
joi | Code snippet | 18.2.3 | 23.69M | None | All errors | 62 μs | 94.21x | |||
zod/mini (jitless) | Code snippet | 4.4.3 | 240.5M | None | All errors | 65 μs | 98.72x | |||
zod/mini | Code snippet | 4.4.3 | 240.5M | JIT | All errors | 66 μs | 99.26x | |||
zod | Code snippet | 4.4.3 | 240.5M | JIT | All errors | 75 μs | 112.78x | |||
superstruct | Code snippet | 2.0.2 | 5.65M | None | All errors | 81 μs | 121.78x | |||
superstruct | Code snippet | 2.0.2 | 5.65M | None | All errors | 81 μs | 122.18x | |||
zod (jitless) | Code snippet | 4.4.3 | 240.5M | None | All errors | 81 μs | 122.24x | |||
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 | 81 μs | 122.9x | ||
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 | 86 μs | 129.97x | ||
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 | 91 μs | 137.02x | ||
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 | 91 μs | 137.61x | ||
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 | 96 μs | 144.86x | ||
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 | 98 μs | 147.59x | ||
arktype | Code snippet | 2.2.3 | 1.39M | JIT | All errors | 101 μs | 152.55x | |||
runtypes | Code snippet | 7.0.4 | 305.32K | None | Abort early | 189 μs | 285.28x | |||
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 | 203 μs | 306.62x | ||
@sapphire/shapeshift (run) | Code snippet | 4.0.0 | 1.06M | None | All errors | 276 μs | 416.3x | |||
@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 | 277 μs | 417.34x | ||
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 | 538 μs | 811.94x | ||