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
typia (createIs)
Code snippetCode snippet
// const is = typia.createIs<TypiaSchema>();
is(data);

(Commented code is not benchmarked)

12.0.1282.35KPrecompiled49 ns
typia (is)
Code snippetCode snippet
typia.is<TypiaSchema>(data)
12.0.1282.35KPrecompiled63 ns
1.3x
stat_minus_1
typebox (schema compile)
Code snippetCode snippet
// const compiledSchema = Schema.Compile(schema);
compiledSchema.Check(data);

(Commented code is not benchmarked)

1.1.6227.83KJIT68 ns
1.4x
stat_minus_1
typebox (compile)
Code snippetCode snippet
// const compiled = Compile(schema);
compiled.Check(data);

(Commented code is not benchmarked)

1.1.6227.83KJIT68 ns
1.41x
stat_minus_1
ajv (compile)
Code snippetCode snippet
// const validate = ajv.compile(schema);
validate(data);

(Commented code is not benchmarked)

8.18.0268.09MJIT101 ns
2.09x
stat_minus_1
ajv (validate)
Code snippetCode snippet
ajv.validate(schema, data)
8.18.0268.09MJIT123 ns
2.53x
stat_minus_1
io-ts
Code snippetCode snippet
schema.is(data)
2.2.222.81MNone128 ns
2.64x
stat_minus_1
ata-validator
Code snippetCode snippet
schema.isValidObject(data)
0.4.151.85KJIT357 ns
7.34x
stat_minus_1
@railway-ts/pipelines
Code snippetCode snippet
is(data, schema)
0.1.2731None657 ns
13.53x
stat_minus_1
valibot
Code snippetCode snippet
v.is(schema, data)
1.3.17.46MNone697 ns
14.34x
stat_minus_1
effect
Code snippetCode snippet
// const is = Schema.is(schema);
is(data);

(Commented code is not benchmarked)

3.21.09.07MNone759 ns
15.62x
stat_minus_1
arktype
Code snippetCode snippet
schema.allows(data)
2.2.0911.72KJIT774 ns
15.94x
stat_minus_1
effect@beta
Code snippetCode snippet
// const is = Schema.is(schema);
is(data);

(Commented code is not benchmarked)

4.0.0-beta.409.07MNone1 μs
21.37x
stat_minus_1
typebox
Code snippetCode snippet
Value.Check(schema, data)
1.1.6227.83KJIT4 μs
74.38x
stat_minus_1
typebox (schema)
Code snippetCode snippet
Schema.Check(schema, data)
1.1.6227.83KJIT4 μs
87.85x
stat_minus_1
superstruct
Code snippetCode snippet
is(data, schema)
2.0.24.11MNone10 μs
214.64x
stat_minus_1
superstruct (schema.is)
Code snippetCode snippet
schema.is(data)
2.0.24.11MNone11 μs
218.89x
stat_minus_1
yup
Code snippetCode snippet
schema.isValidSync(data)
1.7.110.53MNone94 μs
1_944.21x
stat_minus_2
runtypes
Code snippetCode snippet
schema.guard(data)
7.0.4264.28KNone190 μs
3_912.2x
stat_minus_3
Created by eskimojo for Open Circle