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 | 24 | None | Abort early | 627 ns | ||||
valibot | Code snippet | 1.4.2 | 13.57M | None | Abort early | 723 ns | 1.15x | |||
@paseri/compiler (safeParse) | Code snippet | 0.7.5 | 37 | Precompiled | All errors | 1 μs | 2.15x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.97 | 16.97M | None | Abort early | 1 μs | 2.19x | |||
@paseri/paseri (safeParse) | Code snippet | 1.9.5 | 53 | None | All errors | 4 μs | 5.77x | |||
joi | Code snippet | 18.2.3 | 16.86M | None | Abort early | 4 μs | 6.44x | |||
io-ts | Code snippet | 2.2.22 | 2.34M | None | All errors | 6 μs | 9.39x | |||
typia (createValidate) | Code snippet(Commented code is not benchmarked) | 13.0.2 | 298.11K | Precompiled | All errors | 6 μs | 10.35x | |||
typia (validate) | Code snippet | 13.0.2 | 298.11K | Precompiled | All errors | 7 μs | 11.08x | |||
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.9 | 207.16K | JIT | All errors | 7 μs | 11.17x | ||
@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.5 | 37 | Precompiled | All errors | 7 μs | 11.45x | ||
sury (safe) | Code snippet | 11.0.0-alpha.9 | 207.16K | JIT | All errors | 7 μs | 11.96x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.21.4 | 16.97M | None | Abort early | 9 μs | 14.7x | |||
@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.5 | 53 | None | All errors | 10 μs | 15.6x | ||
superstruct (schema.validate) | Code snippet | 2.0.2 | 5.1M | None | Abort early | 10 μs | 16.12x | |||
superstruct | Code snippet | 2.0.2 | 5.1M | None | Abort early | 10 μs | 16.61x | |||
valibot (abortPipeEarly only) | Code snippet | 1.4.2 | 13.57M | None | Abort early | 27 μs | 43.62x | |||
valibot | Code snippet | 1.4.2 | 13.57M | None | All errors | 28 μs | 43.88x | |||
@railway-ts/pipelines | Code snippet | 0.1.29 | 24 | None | All errors | 29 μs | 46.77x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.21.4 | 16.97M | None | All errors | 30 μs | 47.68x | |||
ata-validator | Code snippet | 0.21.0 | 443 | JIT | All errors | 31 μs | 49.54x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.97 | 16.97M | None | All errors | 32 μs | 50.64x | |||
zod/v3 | Code snippet | 4.4.3 | 208.07M | None | All errors | 37 μs | 58.84x | |||
joi | Code snippet | 18.2.3 | 16.86M | None | All errors | 55 μs | 88.26x | |||
zod/mini | Code snippet | 4.4.3 | 208.07M | JIT | All errors | 57 μs | 91.6x | |||
zod/mini (jitless) | Code snippet | 4.4.3 | 208.07M | None | All errors | 58 μs | 92.06x | |||
zod | Code snippet | 4.4.3 | 208.07M | JIT | All errors | 62 μs | 99.02x | |||
decoders | Code snippet | 2.9.3 | 53.18K | None | All errors | 68 μs | 107.81x | |||
zod (jitless) | Code snippet | 4.4.3 | 208.07M | None | All errors | 69 μs | 109.69x | |||
superstruct | Code snippet | 2.0.2 | 5.1M | None | All errors | 77 μs | 123.63x | |||
superstruct | Code snippet | 2.0.2 | 5.1M | None | All errors | 78 μs | 123.72x | |||
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.6 | 3.4M | JIT | All errors | 78 μs | 125.03x | ||
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.6 | 3.4M | JIT | All errors | 83 μs | 131.95x | ||
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.6 | 3.4M | JIT | All errors | 83 μs | 132.16x | ||
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 | 9.42M | None | Abort early | 83 μs | 132.41x | ||
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.6 | 3.4M | JIT | All errors | 87 μs | 138.01x | ||
arktype | Code snippet | 2.2.3 | 1.15M | JIT | All errors | 89 μs | 141.62x | |||
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.6 | 3.4M | JIT | All errors | 90 μs | 143.33x | ||
runtypes | Code snippet | 7.0.4 | 238.13K | None | Abort early | 170 μs | 270.68x | |||
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 | 238.13K | None | Abort early | 179 μs | 285.94x | ||
@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 | 764.24K | None | All errors | 261 μs | 417.01x | ||
@sapphire/shapeshift (run) | Code snippet | 4.0.0 | 764.24K | None | All errors | 262 μs | 417.56x | |||
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 | 9.42M | None | All errors | 495 μs | 790.17x | ||