LogoLogo

Schema Benchmarks

    • home
      Home

    • download_2
      Download

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

    • error
      Stack

    • deployed_code
      Libraries

    • article
      Blog
Expand sidebarExpand sidebar
Benchmarks/ValidationValidation
github
GitHubGitHub
DiscordDiscord
PreferencesPreferences

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
  • errorInvalid
  • check_circleValid
Optimizations
  • flash_offNone
  • codeJIT
  • buildPrecompiled
LibrarysortVersionDownloads (/wk)sortOptimizationsMeanarrow_upwardCompare
ata-validator
Code snippetCode snippet
schema.isValidObject(data)
1.2.2979JIT48 ns
typia (createIs)
Code snippetCode snippet
// const is = typia.createIs<TypiaSchema>();
is(data);

(Commented code is not benchmarked)

13.2.0322.95KPrecompiled52 ns
1.07x
stat_minus_1
typebox (compile)
Code snippetCode snippet
// const compiled = Compile(schema);
compiled.Check(data);

(Commented code is not benchmarked)

1.3.8n/aJIT65 ns
1.34x
stat_minus_1
typebox (schema compile)
Code snippetCode snippet
// const compiledSchema = Schema.Compile(schema);
compiledSchema.Check(data);

(Commented code is not benchmarked)

1.3.8n/aJIT65 ns
1.35x
stat_minus_1
typebox (script compile)
Code snippetCode snippet
// const compiledScriptSchema = Schema.Compile(scriptSchema);
compiledScriptSchema.Check(data);

(Commented code is not benchmarked)

1.3.8n/aJIT69 ns
1.43x
stat_minus_1
ajv (compile)
Code snippetCode snippet
// const validate = ajv.compile(schema);
validate(data);

(Commented code is not benchmarked)

8.20.0n/aJIT79 ns
1.64x
stat_minus_1
typia (is)
Code snippetCode snippet
typia.is<TypiaSchema>(data)
13.2.0322.95KPrecompiled84 ns
1.73x
stat_minus_1
ajv (validate)
Code snippetCode snippet
ajv.validate(schema, data)
8.20.0n/aJIT120 ns
2.48x
stat_minus_1
io-ts
Code snippetCode snippet
schema.is(data)
2.2.222.71MNone121 ns
2.51x
stat_minus_1
@railway-ts/pipelines
Code snippetCode snippet
is(data, schema)
0.1.29131None674 ns
13.94x
stat_minus_1
effect
Code snippetCode snippet
// const is = Schema.is(schema);
is(data);

(Commented code is not benchmarked)

3.22.0n/aNone697 ns
14.42x
stat_minus_1
valibot
Code snippetCode snippet
v.is(schema, data)
1.4.215.65MNone758 ns
15.68x
stat_minus_1
arktype
Code snippetCode snippet
schema.allows(data)
2.2.3n/aJIT813 ns
16.81x
stat_minus_1
effect@beta
Code snippetCode snippet
// const is = Schema.is(schema);
is(data);

(Commented code is not benchmarked)

4.0.0-beta.101n/aNone1 μs
27.33x
stat_minus_1
typebox
Code snippetCode snippet
Value.Check(schema, data)
1.3.8n/aJIT4 μs
92.89x
stat_minus_1
typebox (schema)
Code snippetCode snippet
Schema.Check(schema, data)
1.3.8n/aJIT5 μs
105.56x
stat_minus_1
sury
Code snippetCode snippet
S.is(S.schema(...), data)
11.0.0-alpha.11n/aJIT8 μs
162.58x
stat_minus_1
superstruct (schema.is)
Code snippetCode snippet
schema.is(data)
2.0.2n/aNone11 μs
220.66x
stat_minus_1
superstruct
Code snippetCode snippet
is(data, schema)
2.0.2n/aNone11 μs
226.48x
stat_minus_1
yup
Code snippetCode snippet
schema.isValidSync(data)
1.7.1n/aNone96 μs
1_974.52x
stat_minus_1
runtypes
Code snippetCode snippet
schema.guard(data)
7.0.4n/aNone198 μs
4_087.36x
stat_minus_3
@sapphire/shapeshift
Code snippetCode snippet
schema.is(data)
4.0.0n/aNone287 μs
5_932.56x
stat_minus_3
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures