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 | 677 ns | ||||
ata-validator | Code snippet | 1.2.2 | 979 | JIT | All errors | 690 ns | 1.02x | |||
valibot | Code snippet | 1.4.2 | 15.65M | None | Abort early | 790 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.01x | |||
@paseri/compiler (safeParse) | Code snippet | 0.7.7 | 104 | Precompiled | All errors | 1 μs | 2.19x | |||
@paseri/paseri (safeParse) | Code snippet | 1.9.7 | 108 | None | All errors | 4 μs | 5.85x | |||
joi | Code snippet | 18.2.3 | 23.69M | None | Abort early | 4 μs | 6.44x | |||
io-ts | Code snippet | 2.2.22 | 2.71M | None | All errors | 6 μs | 8.71x | |||
sury (safe) | Code snippet | 11.0.0-alpha.11 | 291.77K | JIT | All errors | 7 μs | 10.94x | |||
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 | 10.98x | ||
@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 | 8 μs | 11.2x | ||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 26.02M | None | Abort early | 9 μs | 13.87x | |||
superstruct | Code snippet | 2.0.2 | 5.65M | None | Abort early | 10 μs | 15.07x | |||
@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.09x | ||
superstruct (schema.validate) | Code snippet | 2.0.2 | 5.65M | None | Abort early | 10 μs | 15.33x | |||
typia (createValidate) | Code snippet(Commented code is not benchmarked) | 13.2.0 | 322.95K | Precompiled | All errors | 18 μs | 26.04x | |||
typia (validate) | Code snippet | 13.2.0 | 322.95K | Precompiled | All errors | 19 μs | 27.46x | |||
valibot (abortPipeEarly only) | Code snippet | 1.4.2 | 15.65M | None | Abort early | 30 μs | 43.83x | |||
valibot | Code snippet | 1.4.2 | 15.65M | None | All errors | 30 μs | 44.67x | |||
@railway-ts/pipelines | Code snippet | 0.1.29 | 131 | None | All errors | 31 μs | 45.43x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 26.02M | None | All errors | 32 μs | 46.69x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.101 | 26.02M | None | All errors | 32 μs | 47.3x | |||
zod/v3 | Code snippet | 4.4.3 | 240.5M | None | All errors | 40 μs | 59.55x | |||
decoders | Code snippet | 2.9.3 | 54.62K | None | All errors | 63 μs | 93.03x | |||
zod/mini | Code snippet | 4.4.3 | 240.5M | JIT | All errors | 66 μs | 97.65x | |||
zod/mini (jitless) | Code snippet | 4.4.3 | 240.5M | None | All errors | 66 μs | 98.02x | |||
joi | Code snippet | 18.2.3 | 23.69M | None | All errors | 69 μs | 102.41x | |||
zod | Code snippet | 4.4.3 | 240.5M | JIT | All errors | 76 μs | 112.41x | |||
superstruct | Code snippet | 2.0.2 | 5.65M | None | All errors | 82 μs | 120.84x | |||
zod (jitless) | Code snippet | 4.4.3 | 240.5M | None | All errors | 82 μs | 121.29x | |||
superstruct | Code snippet | 2.0.2 | 5.65M | None | All errors | 82 μs | 121.49x | |||
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 | 82 μs | 121.75x | ||
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 | 87 μs | 128.94x | ||
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 | 134.62x | ||
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 | 92 μs | 135.99x | ||
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 | 95 μs | 140.98x | ||
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 | 144.76x | ||
arktype | Code snippet | 2.2.3 | 1.39M | JIT | All errors | 98 μs | 145.4x | |||
runtypes | Code snippet | 7.0.4 | 305.32K | None | Abort early | 193 μs | 284.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 | 305.32K | None | Abort early | 209 μs | 309.5x | ||
@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 | 281 μs | 415.32x | ||
@sapphire/shapeshift (run) | Code snippet | 4.0.0 | 1.06M | None | All errors | 281 μs | 415.82x | |||
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 | 794.36x | ||