LogoLogo

Schema Benchmarks

    • home
      Home

    • download_2
      Download

    • timer
      Initialization
    • check_circle
      Validation
    • output_circle
      Parsing
    • swap_horiz
      Codec
    • schema
      Standard Schema
    • format_quote
      String

    • error
      Stack

    • article
      Blog
Code styleCode style
Normal styleNormal style
System themeSystem theme
Light themeLight theme
Dark themeDark theme
Expand sidebarExpand sidebar
Benchmarks/ValidationValidation
Code styleCode style
Normal styleNormal style
System themeSystem theme
Light themeLight theme
Dark themeDark theme
github
GitHubGitHub
DiscordDiscord

Checking if a given value matches the schema. This is different to parsing because it doesn't return a new value.

Copy to clipboardCopy to clipboard
import * as v from "valibot"; import { personSchema } from "./schemas"; if (v.is(personSchema, data)) { // data is narrowed to Person }
Data
errorInvalidcheck_circleValid
Optimizations
flash_offNonecodeJITbuildPrecompiled
LibrarysortVersionDownloads (/wk)sortOptimizationsMeanarrow_upwardCompare
ata-validator
Code snippetCode snippet
schema.isValidObject(data)
0.8.0728JIT157 ns
typia (createIs)
Code snippetCode snippet
// const is = typia.createIs<TypiaSchema>();
is(data);

(Commented code is not benchmarked)

12.0.2259.06KPrecompiled1 μs
7x
stat_minus_1
typia (is)
Code snippetCode snippet
typia.is<TypiaSchema>(data)
12.0.2259.06KPrecompiled1 μs
7.2x
stat_minus_1
typebox (schema compile)
Code snippetCode snippet
// const compiledSchema = Schema.Compile(schema);
compiledSchema.Check(data);

(Commented code is not benchmarked)

1.1.23277.92KJIT3 μs
18.68x
stat_minus_1
typebox (compile)
Code snippetCode snippet
// const compiled = Compile(schema);
compiled.Check(data);

(Commented code is not benchmarked)

1.1.23277.92KJIT3 μs
19.91x
stat_minus_1
ajv (compile)
Code snippetCode snippet
// const validate = ajv.compile(schema);
validate(data);

(Commented code is not benchmarked)

8.18.0259.98MJIT3 μs
19.94x
stat_minus_1
ajv (validate)
Code snippetCode snippet
ajv.validate(schema, data)
8.18.0259.98MJIT3 μs
20.2x
stat_minus_1
io-ts
Code snippetCode snippet
schema.is(data)
2.2.222.92MNone3 μs
20.64x
stat_minus_1
arktype
Code snippetCode snippet
schema.allows(data)
2.2.0885.45KJIT7 μs
42.14x
stat_minus_1
valibot
Code snippetCode snippet
v.is(schema, data)
1.3.17.93MNone12 μs
75.34x
stat_minus_1
@railway-ts/pipelines
Code snippetCode snippet
is(data, schema)
0.1.2734None18 μs
113.52x
stat_minus_1
effect@beta
Code snippetCode snippet
// const is = Schema.is(schema);
is(data);

(Commented code is not benchmarked)

4.0.0-beta.469.44MNone21 μs
132.19x
stat_minus_1
effect
Code snippetCode snippet
// const is = Schema.is(schema);
is(data);

(Commented code is not benchmarked)

3.21.09.44MNone23 μs
145.11x
stat_minus_1
@sapphire/shapeshift
Code snippetCode snippet
schema.is(data)
4.0.0629.44KNone25 μs
160x
stat_minus_1
superstruct (schema.is)
Code snippetCode snippet
schema.is(data)
2.0.24.02MNone53 μs
334.65x
stat_minus_2
superstruct
Code snippetCode snippet
is(data, schema)
2.0.24.02MNone53 μs
336.22x
stat_minus_2
runtypes
Code snippetCode snippet
schema.guard(data)
7.0.4279.42KNone68 μs
434.51x
stat_minus_2
typebox (schema)
Code snippetCode snippet
Schema.Check(schema, data)
1.1.23277.92KJIT76 μs
480.97x
stat_minus_2
typebox
Code snippetCode snippet
Value.Check(schema, data)
1.1.23277.92KJIT78 μs
495.14x
stat_minus_2
yup
Code snippetCode snippet
schema.isValidSync(data)
1.7.110.79MNone139 μs
884.54x
stat_minus_3
Created by eskimojo for Open Circle