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
    • assignment_turned_in
      TypeScript

  • 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
io-ts
Code snippetCode snippet
schema.is(data)
2.2.22n/aNone2 μs
valibot
Code snippetCode snippet
v.is(schema, data)
1.5.0n/aNone4 μs
2.25x
stat_minus_1
effect
Code snippetCode snippet
const is = Schema.is(schema);
is(data);

(Setup code is not benchmarked)

4.0.1n/aNone5 μs
2.53x
stat_minus_1
@railway-ts/pipelines
Code snippetCode snippet
is(data, schema)
0.1.29n/aNone11 μs
5.39x
stat_minus_1
@sapphire/shapeshift
Code snippetCode snippet
schema.is(data)
5.0.0n/aNone13 μs
6.55x
stat_minus_1
superstruct (schema.is)
Code snippetCode snippet
schema.is(data)
2.0.2n/aNone34 μs
17.23x
stat_minus_2
superstruct
Code snippetCode snippet
is(data, schema)
2.0.2n/aNone34 μs
17.29x
stat_minus_2
runtypes
Code snippetCode snippet
schema.guard(data)
7.0.5n/aNone51 μs
25.54x
stat_minus_2
yup
Code snippetCode snippet
schema.isValidSync(data)
1.7.1n/aNone91 μs
45.46x
stat_minus_3
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures