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 | 226 | None | Abort early | 673 ns | ||||
valibot | Code snippet | 1.4.2 | 15.99M | None | Abort early | 721 ns | 1.07x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.98 | 24.01M | None | Abort early | 1 μs | 1.8x | |||
@paseri/compiler (safeParse) | Code snippet | 0.7.5 | 109 | Precompiled | All errors | 1 μs | 2.08x | |||
joi | Code snippet | 18.2.3 | 22.46M | None | Abort early | 4 μs | 5.78x | |||
@paseri/paseri (safeParse) | Code snippet | 1.9.5 | 119 | None | All errors | 4 μs | 5.86x | |||
io-ts | Code snippet | 2.2.22 | 2.69M | None | All errors | 6 μs | 8.52x | |||
typia (createValidate) | Code snippet(Commented code is not benchmarked) | 13.1.0 | 312.92K | Precompiled | All errors | 7 μs | 9.9x | |||
typia (validate) | Code snippet | 13.1.0 | 312.92K | Precompiled | All errors | 7 μs | 10.59x | |||
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.10 | 297.33K | JIT | All errors | 7 μs | 10.74x | ||
sury (safe) | Code snippet | 11.0.0-alpha.10 | 297.33K | JIT | All errors | 7 μs | 11.02x | |||
@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 | 109 | Precompiled | All errors | 7 μs | 11.1x | ||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 24.01M | None | Abort early | 9 μs | 13.34x | |||
@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 | 119 | None | All errors | 10 μs | 15.18x | ||
superstruct (schema.validate) | Code snippet | 2.0.2 | 5.44M | None | Abort early | 11 μs | 15.77x | |||
superstruct | Code snippet | 2.0.2 | 5.44M | None | Abort early | 11 μs | 15.92x | |||
effect@beta | Code snippet(Commented code is not benchmarked) | 4.0.0-beta.98 | 24.01M | None | All errors | 21 μs | 31.6x | |||
valibot | Code snippet | 1.4.2 | 15.99M | None | All errors | 29 μs | 43.46x | |||
valibot (abortPipeEarly only) | Code snippet | 1.4.2 | 15.99M | None | Abort early | 29 μs | 43.73x | |||
@railway-ts/pipelines | Code snippet | 0.1.29 | 226 | None | All errors | 30 μs | 44.97x | |||
effect | Code snippet(Commented code is not benchmarked) | 3.22.0 | 24.01M | None | All errors | 31 μs | 45.76x | |||
ata-validator | Code snippet | 0.21.0 | 1.08K | JIT | All errors | 34 μs | 51.21x | |||
zod/v3 | Code snippet | 4.4.3 | 245.4M | None | All errors | 39 μs | 57.99x | |||
joi | Code snippet | 18.2.3 | 22.46M | None | All errors | 60 μs | 89.35x | |||
zod/mini (jitless) | Code snippet | 4.4.3 | 245.4M | None | All errors | 66 μs | 97.54x | |||
zod/mini | Code snippet | 4.4.3 | 245.4M | JIT | All errors | 66 μs | 98.36x | |||
decoders | Code snippet | 2.9.3 | 49.01K | None | All errors | 69 μs | 101.95x | |||
zod | Code snippet | 4.4.3 | 245.4M | JIT | All errors | 75 μs | 111.66x | |||
superstruct | Code snippet | 2.0.2 | 5.44M | None | All errors | 79 μs | 117.67x | |||
superstruct | Code snippet | 2.0.2 | 5.44M | None | All errors | 79 μs | 118.02x | |||
zod (jitless) | Code snippet | 4.4.3 | 245.4M | None | All errors | 80 μs | 119.41x | |||
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 | 6.2M | JIT | All errors | 81 μs | 119.77x | ||
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 | 6.2M | JIT | All errors | 85 μs | 126.84x | ||
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 | 6.2M | JIT | All errors | 89 μs | 132.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.6 | 6.2M | JIT | All errors | 91 μs | 135.72x | ||
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 | 6.2M | JIT | All errors | 96 μs | 142.46x | ||
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.52M | None | Abort early | 96 μs | 142.65x | ||
arktype | Code snippet | 2.2.3 | 1.37M | JIT | All errors | 98 μs | 146.12x | |||
runtypes | Code snippet | 7.0.4 | 251.33K | None | Abort early | 188 μs | 278.9x | |||
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 | 251.33K | None | Abort early | 205 μs | 304.72x | ||
@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 | 956.89K | None | All errors | 272 μs | 403.59x | ||
@sapphire/shapeshift (run) | Code snippet | 4.0.0 | 956.89K | None | All errors | 273 μs | 406.09x | |||
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.52M | None | All errors | 530 μs | 787.16x | ||