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

  • JSON Schema

    • data_object
      Schema to JSON
    • code
      JSON to Schema
    • verified
      Compliance

    • 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
LibrarysortVersiondownload/wksortOptimizationsMeanarrow_upwardCompare
ata-validator
Code snippetCode snippet
schema.isValidObject(data)
1.6.11.06KJIT50 ns
typebox (schema compile)
Code snippetCode snippet
// const compiledSchema = Schema.Compile(schema);
compiledSchema.Check(data);

(Commented code is not benchmarked)

1.3.157.55MJIT68 ns
1.34x
stat_minus_1
typebox (compile)
Code snippetCode snippet
// const compiled = Compile(schema);
compiled.Check(data);

(Commented code is not benchmarked)

1.3.157.55MJIT71 ns
1.41x
stat_minus_1
typebox (script compile)
Code snippetCode snippet
// const compiledScriptSchema = Schema.Compile(scriptSchema);
compiledScriptSchema.Check(data);

(Commented code is not benchmarked)

1.3.157.55MJIT76 ns
1.5x
stat_minus_1
ajv (compile)
Code snippetCode snippet
// const validate = ajv.compile(schema);
validate(data);

(Commented code is not benchmarked)

8.20.0313.27MJIT83 ns
1.64x
stat_minus_1
ajv (validate)
Code snippetCode snippet
ajv.validate(schema, data)
8.20.0313.27MJIT113 ns
2.23x
stat_minus_1
arktype
Code snippetCode snippet
schema.allows(data)
2.2.31.4MJIT1 μs
19.92x
stat_minus_1
typebox (schema)
Code snippetCode snippet
Schema.Check(schema, data)
1.3.157.55MJIT4 μs
84.89x
stat_minus_2
typebox
Code snippetCode snippet
Value.Check(schema, data)
1.3.157.55MJIT4 μs
85.78x
stat_minus_2
sury
Code snippetCode snippet
S.is(S.schema(...), data)
11.0.0-rc.1240.68KJIT9 μs
175.29x
stat_minus_3
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures