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.1261.03KPrecompiled48 ns
typia (is)
Code snippetCode snippet
typia.is<TypiaSchema>(data)
12.0.1261.03KPrecompiled61 ns
1.27x
stat_minus_1
typebox (schema compile)
Code snippetCode snippet
// const compiledSchema = Schema.Compile(schema);
compiledSchema.Check(data);

(Commented code is not benchmarked)

1.1.6281.23KJIT64 ns
1.33x
stat_minus_1
typebox (compile)
Code snippetCode snippet
// const compiled = Compile(schema);
compiled.Check(data);

(Commented code is not benchmarked)

1.1.6281.23KJIT66 ns
1.36x
stat_minus_1
ajv (compile)
Code snippetCode snippet
// const validate = ajv.compile(schema);
validate(data);

(Commented code is not benchmarked)

8.18.0270.68MJIT85 ns
1.77x
stat_minus_1
ajv (validate)
Code snippetCode snippet
ajv.validate(schema, data)
8.18.0270.68MJIT121 ns
2.5x
stat_minus_1
io-ts
Code snippetCode snippet
schema.is(data)
2.2.222.92MNone125 ns
2.59x
stat_minus_1
@railway-ts/pipelines
Code snippetCode snippet
is(data, schema)
0.1.27364None649 ns
13.42x
stat_minus_1
valibot
Code snippetCode snippet
v.is(schema, data)
1.3.18.61MNone702 ns
14.51x
stat_minus_1
effect
Code snippetCode snippet
// const is = Schema.is(schema);
is(data);

(Commented code is not benchmarked)

3.20.011.72MNone711 ns
14.71x
stat_minus_1
arktype
Code snippetCode snippet
schema.allows(data)
2.2.0814.62KJIT762 ns
15.76x
stat_minus_1
effect@beta
Code snippetCode snippet
// const is = Schema.is(schema);
is(data);

(Commented code is not benchmarked)

4.0.0-beta.3511.72MNone1 μs
21.99x
stat_minus_1
typebox
Code snippetCode snippet
Value.Check(schema, data)
1.1.6281.23KJIT4 μs
74.16x
stat_minus_1
typebox (schema)
Code snippetCode snippet
Schema.Check(schema, data)
1.1.6281.23KJIT4 μs
87.24x
stat_minus_1
yup
Code snippetCode snippet
schema.isValidSync(data)
1.7.110.63MNone95 μs
1_961.93x
stat_minus_3
Created by eskimojo for Open Circle