LogoLogo

Schema Benchmarks

    • home
      Home

    • download_2
      Download
    • timer
      Initialization
    • check_circle
      Validation
    • output_circle
      Parsing
    • 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.

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)

11.0.3244KPrecompiled49 ns
typia (is)
Code snippetCode snippet
typia.is<TypiaSchema>(data)
11.0.3244KPrecompiled63 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.5204KJIT64 ns
1.32x
stat_minus_1
typebox (compile)
Code snippetCode snippet
// const compiled = Compile(schema);
compiled.Check(data);

(Commented code is not benchmarked)

1.1.5204KJIT65 ns
1.34x
stat_minus_1
ajv (compile)
Code snippetCode snippet
// const validate = ajv.compile(schema);
validate(data);

(Commented code is not benchmarked)

8.18.0258MJIT87 ns
1.8x
stat_minus_1
io-ts
Code snippetCode snippet
schema.is(data)
2.2.222.6MNone123 ns
2.53x
stat_minus_1
ajv (validate)
Code snippetCode snippet
ajv.validate(schema, data)
8.18.0258MJIT127 ns
2.61x
stat_minus_1
@railway-ts/pipelines
Code snippetCode snippet
is(data, schema)
0.1.27155None658 ns
13.55x
stat_minus_1
valibot
Code snippetCode snippet
v.is(schema, data)
1.2.06.6MNone703 ns
14.49x
stat_minus_1
effect
Code snippetCode snippet
// const is = Schema.is(schema);
is(data);

(Commented code is not benchmarked)

3.19.198.3MNone709 ns
14.61x
stat_minus_1
arktype
Code snippetCode snippet
schema.allows(data)
2.1.29972KJIT781 ns
16.1x
stat_minus_1
effect@beta
Code snippetCode snippet
// const is = Schema.is(schema);
is(data);

(Commented code is not benchmarked)

4.0.0-beta.58.3MNone1 μs
21.83x
stat_minus_1
typebox
Code snippetCode snippet
Value.Check(schema, data)
1.1.5204KJIT4 μs
74.32x
stat_minus_1
typebox (schema)
Code snippetCode snippet
Schema.Check(schema, data)
1.1.5204KJIT4 μs
80.82x
stat_minus_1
yup
Code snippetCode snippet
schema.isValidSync(data)
1.7.110MNone96 μs
1_969.79x
stat_minus_3
Created by eskimojo for Open Circle