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/InitializationInitialization
github
GitHubGitHub
DiscordDiscord
PreferencesPreferences

Creating a schema. This is usually a one time cost.

schemas.ts
Copy to clipboardCopy to clipboard
import * as v from "valibot"; export const personSchema = v.object({ name: v.string(), age: v.number(), });
Optimizations
  • flash_offNone
  • codeJIT
  • buildPrecompiled
LibrarysortVersiondownload/wkarrow_upwardOptimizationsMeansortCompare
@paseri/paseri
Code snippetCode snippet
p.object(shape)
1.9.71.06KNone4 μs
@railway-ts/pipelines
Code snippetCode snippet
object(schema)
0.1.29n/aNone2 μs
2.51x
stat_1
@remix-run/data-schema
Code snippetCode snippet
object(shape)
1.0.0n/aNone13 μs
2.99x
stat_minus_1
@sapphire/shapeshift
Code snippetCode snippet
s.object(shape)
5.0.0n/aNone37 μs
8.64x
stat_minus_1
ajv
Code snippetCode snippet
ajv.compile(schema)
8.20.0n/aJIT4 ms
961.4x
stat_minus_3
arktype
Code snippetCode snippet
type(def)
2.2.8n/aJIT332 μs
78.19x
stat_minus_1
ata-validator
Code snippetCode snippet
new Validator(schema)
1.46.1n/aJIT1 μs
3.21x
stat_1
decoders
Code snippetCode snippet
object(decoders)
2.12.2n/aNone8 μs
1.79x
stat_minus_1
effect
Code snippetCode snippet
Schema.Struct(fields)
4.0.2n/aNone19 μs
4.51x
stat_minus_1
effect (decodeUnknownOption)
Code snippetCode snippet
Schema.decodeUnknownOption(Schema.Struct(fields))
4.0.2n/aNone19 μs
4.45x
stat_minus_1
io-ts
Code snippetCode snippet
t.type(props)
2.2.22n/aNone3 μs
1.22x
stat_1
joi
Code snippetCode snippet
object(schema)
18.2.9n/aNone111 μs
26.22x
stat_minus_1
runtypes
Code snippetCode snippet
Object(fields)
7.0.5n/aNone996 μs
234.38x
stat_minus_1
superstruct
Code snippetCode snippet
object(schema)
2.0.2n/aNone5 μs
1.19x
stat_minus_1
sury
Code snippetCode snippet
S.schema(value)
11.0.0n/aJIT6 μs
1.4x
stat_minus_1
sury (isInput)
Code snippetCode snippet
S.isInput(S.schema(value))
11.0.0n/aJIT139 μs
32.65x
stat_minus_1
sury (parseOrThrow)
Code snippetCode snippet
S.parseOrThrow(S.schema(value))
11.0.0n/aJIT114 μs
26.8x
stat_minus_1
typebox
Code snippetCode snippet
Type.Object(properties)
1.3.36n/aJIT10 μs
2.35x
stat_minus_1
typebox (compile)
Code snippetCode snippet
Compile(Type.Object(properties))
1.3.36n/aJIT150 μs
35.36x
stat_minus_1
typebox (schema compile)
Code snippetCode snippet
Schema.Compile(Type.Object(properties))
1.3.36n/aJIT139 μs
32.71x
stat_minus_1
typebox (script compile)
Code snippetCode snippet
Schema.Compile(Type.Script(context, input))
1.3.36n/aJIT1 ms
337.27x
stat_minus_2
typebox (script)
Code snippetCode snippet
Type.Script(context, input)
1.3.36n/aJIT1 ms
323.85x
stat_minus_2
typia (createIs)
Code snippetCode snippet
typia.createIs<TypiaSchema>()
15.1.0n/aPrecompiled85 ns
49.79x
stat_1
typia (createValidate)
Code snippetCode snippet
typia.createValidate<TypiaSchema>()
15.1.0n/aPrecompiled267 ns
15.88x
stat_1
valibot
Code snippetCode snippet
v.object(entries)
1.5.0n/aNone3 μs
1.22x
stat_1
yup
Code snippetCode snippet
object(spec)
1.7.1n/aNone101 μs
23.76x
stat_minus_1
zod
Code snippetCode snippet
z.object({
  title: z.string().min(1).max(100),
  ...shape
})
4.6.5n/aJIT158 μs
37.14x
stat_minus_1
zod (compile)
Code snippetCode snippet
z.compile(z.object(shape), { strict: true })
4.6.5n/aJIT324 μs
76.3x
stat_minus_1
zod (factory)
Code snippetCode snippet
z.object({
  title: z.string({ 
    checks: [
      z.minLength(1), 
      z.maxLength(100)
    ],
  }),
  ...shape
})
4.6.5n/aJIT70 μs
16.38x
stat_minus_1
zod/mini
Code snippetCode snippet
z.object({
  title: z.string().check(
    z.minLength(1), 
    z.maxLength(100),
  ),
  ...shape
})
4.6.5n/aJIT79 μs
18.63x
stat_minus_1
zod/mini (compile)
Code snippetCode snippet
z.compile(z.object(shape), { strict: true })
4.6.5n/aJIT238 μs
56x
stat_minus_1
zod/mini (factory)
Code snippetCode snippet
z.object({
  title: z.string({ 
    checks: [
      z.minLength(1), 
      z.maxLength(100),
    ],
  }),
  ...shape
})
4.6.5n/aJIT56 μs
13.3x
stat_minus_1
zod/v3
Code snippetCode snippet
z.object(shape)
4.6.5n/aNone42 μs
9.86x
stat_minus_1
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures