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 | ||||
|---|---|---|---|---|---|---|---|---|---|---|
ata-validator | Code snippet | 0.6.1 | 1.25K | JIT | All errors | 533 ns | ||||
@railway-ts/pipelines | Code snippet | 0.1.27 | 89 | None | Abort early | 656 ns | 1.23x | |||
valibot | Code snippet | 1.3.1 | 7.13M | None | Abort early | 674 ns | 1.26x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.43 | 8.99M | None | Abort early | 1 μs | 2.08x | |||
joi | Code snippet | 18.1.2 | 17.37M | None | Abort early | 4 μs | 7.37x | |||
typia (createValidate) | Code snippet(Commented code is not benchmarked) | 12.0.2 | 234.4K | Precompiled | All errors | 6 μs | 11.29x | |||
io-ts | Code snippet | 2.2.22 | 2.92M | None | All errors | 6 μs | 11.6x | |||
typia (validate) | Code snippet | 12.0.2 | 234.4K | Precompiled | All errors | 6 μs | 11.82x | |||
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 | 111.6K | JIT | All errors | 7 μs | 13.31x | ||
sury (compile + safe) | Code snippet(Commented code is not benchmarked) | 11.0.0-alpha.4 | 111.6K | JIT | All errors | 7 μs | 13.86x | |||
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 | 111.6K | JIT | All errors | 7 μs | 14.02x | ||
sury (safe) | Code snippet | 11.0.0-alpha.4 | 111.6K | JIT | All errors | 8 μs | 14.09x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.21.0 | 8.99M | None | Abort early | 9 μs | 16.55x | |||
superstruct | Code snippet | 2.0.2 | 3.93M | None | Abort early | 10 μs | 19.2x | |||
superstruct (schema.validate) | Code snippet | 2.0.2 | 3.93M | None | Abort early | 10 μs | 19.55x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.43 | 8.99M | None | All errors | 22 μs | 40.79x | |||
valibot (abortPipeEarly only) | Code snippet | 1.3.1 | 7.13M | None | Abort early | 28 μs | 52.14x | |||
valibot | Code snippet | 1.3.1 | 7.13M | None | All errors | 28 μs | 52.75x | |||
@railway-ts/pipelines | Code snippet | 0.1.27 | 89 | None | All errors | 30 μs | 55.98x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.21.0 | 8.99M | None | All errors | 32 μs | 60.54x | |||
zod/v3 | Code snippet | 4.3.6 | 139.49M | None | All errors | 39 μs | 73.55x | |||
joi | Code snippet | 18.1.2 | 17.37M | None | All errors | 53 μs | 98.99x | |||
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.14 | 231.35K | JIT | All errors | 65 μs | 121.51x | ||
zod/mini (jitless) | Code snippet | 4.3.6 | 139.49M | None | All errors | 65 μs | 122.26x | |||
zod/mini | Code snippet | 4.3.6 | 139.49M | JIT | All errors | 66 μs | 123.1x | |||
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.14 | 231.35K | JIT | All errors | 68 μs | 127.34x | ||
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.14 | 231.35K | JIT | All errors | 71 μs | 132.49x | ||
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.14 | 231.35K | JIT | All errors | 76 μs | 142.88x | ||
zod | Code snippet | 4.3.6 | 139.49M | JIT | All errors | 78 μs | 146.16x | |||
superstruct | Code snippet | 2.0.2 | 3.93M | None | All errors | 81 μs | 151.8x | |||
superstruct | Code snippet | 2.0.2 | 3.93M | None | All errors | 81 μs | 152.4x | |||
zod (jitless) | Code snippet | 4.3.6 | 139.49M | None | All errors | 82 μs | 153.12x | |||
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.02M | None | Abort early | 87 μs | 163.94x | ||
decoders | Code snippet | 2.9.2 | 42.73K | None | All errors | 88 μs | 164.61x | |||
arktype | Code snippet | 2.2.0 | 869.14K | JIT | All errors | 104 μs | 196x | |||
runtypes | Code snippet | 7.0.4 | 256.41K | None | Abort early | 193 μs | 361.63x | |||
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 | 256.41K | None | Abort early | 203 μs | 381.3x | ||
@sapphire/shapeshift (run) | Code snippet | 4.0.0 | 642.42K | None | All errors | 261 μs | 490.04x | |||
@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 | 642.42K | None | All errors | 263 μs | 493.03x | ||
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.02M | None | All errors | 486 μs | 911.48x | ||