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
Libraryarrow_upwardVersiondownload/wksortOptimizationsMeansortCompare
zod/v3
Code snippetCode snippet
z.object(shape)
4.6.5n/aNone36 μs
zod/mini (factory)
Code snippetCode snippet
z.object({
  title: z.string({ 
    checks: [
      z.minLength(1), 
      z.maxLength(100),
    ],
  }),
  ...shape
})
4.6.5n/aJIT52 μs
1.46x
stat_minus_1
zod/mini (compile)
Code snippetCode snippet
z.compile(z.object(shape), { strict: true })
4.6.5n/aJIT200 μs
5.64x
stat_minus_1
zod/mini
Code snippetCode snippet
z.object({
  title: z.string().check(
    z.minLength(1), 
    z.maxLength(100),
  ),
  ...shape
})
4.6.5n/aJIT70 μs
1.96x
stat_minus_1
zod (factory)
Code snippetCode snippet
z.object({
  title: z.string({ 
    checks: [
      z.minLength(1), 
      z.maxLength(100)
    ],
  }),
  ...shape
})
4.6.5n/aJIT61 μs
1.72x
stat_minus_1
zod (compile)
Code snippetCode snippet
z.compile(z.object(shape), { strict: true })
4.6.5n/aJIT269 μs
7.56x
stat_minus_1
zod
Code snippetCode snippet
z.object({
  title: z.string().min(1).max(100),
  ...shape
})
4.6.5n/aJIT139 μs
3.91x
stat_minus_1
yup
Code snippetCode snippet
object(spec)
1.7.1n/aNone81 μs
2.27x
stat_minus_1
valibot
Code snippetCode snippet
v.object(entries)
1.5.0n/aNone2 μs
16.44x
stat_1
typia (createValidate)
Code snippetCode snippet
typia.createValidate<TypiaSchema>()
14.0.6n/aPrecompiled111 ns
320.2x
stat_2
typia (createIs)
Code snippetCode snippet
typia.createIs<TypiaSchema>()
14.0.6n/aPrecompiled58 ns
612.08x
stat_3
typebox (script)
Code snippetCode snippet
Type.Script(context, input)
1.3.34n/aJIT1 ms
29.92x
stat_minus_1
typebox (script compile)
Code snippetCode snippet
Schema.Compile(Type.Script(context, input))
1.3.34n/aJIT1 ms
30.14x
stat_minus_1
typebox (schema compile)
Code snippetCode snippet
Schema.Compile(Type.Object(properties))
1.3.34n/aJIT120 μs
3.39x
stat_minus_1
typebox (compile)
Code snippetCode snippet
Compile(Type.Object(properties))
1.3.34n/aJIT127 μs
3.57x
stat_minus_1
typebox
Code snippetCode snippet
Type.Object(properties)
1.3.34n/aJIT9 μs
4.09x
stat_1
sury (parseOrThrow)
Code snippetCode snippet
S.parseOrThrow(S.schema(value))
11.0.0n/aJIT104 μs
2.93x
stat_minus_1
sury (isInput)
Code snippetCode snippet
S.isInput(S.schema(value))
11.0.0n/aJIT127 μs
3.57x
stat_minus_1
sury
Code snippetCode snippet
S.schema(value)
11.0.0n/aJIT5 μs
7.35x
stat_1
superstruct
Code snippetCode snippet
object(schema)
2.0.2n/aNone3 μs
10.69x
stat_1
runtypes
Code snippetCode snippet
Object(fields)
7.0.5n/aNone804 μs
22.63x
stat_minus_1
joi
Code snippetCode snippet
object(schema)
18.2.9n/aNone94 μs
2.63x
stat_minus_1
io-ts
Code snippetCode snippet
t.type(props)
2.2.22n/aNone2 μs
14.3x
stat_1
effect@rc (decodeUnknownOption)
Code snippetCode snippet
Schema.decodeUnknownOption(Schema.Struct(fields))
4.0.0-rc.112n/aNone114 μs
3.2x
stat_minus_1
effect@rc
Code snippetCode snippet
Schema.Struct(fields)
4.0.0-rc.112n/aNone118 μs
3.32x
stat_minus_1
effect (decodeUnknownEither)
Code snippetCode snippet
Schema.decodeUnknownEither(Schema.Struct(fields))
3.22.2n/aNone385 μs
10.84x
stat_minus_1
effect
Code snippetCode snippet
Schema.Struct(fields)
3.22.2n/aNone334 μs
9.4x
stat_minus_1
decoders
Code snippetCode snippet
object(decoders)
2.10.1n/aNone5 μs
7.01x
stat_1
ata-validator
Code snippetCode snippet
new Validator(schema)
1.27.1n/aJIT9 μs
4.17x
stat_1
arktype
Code snippetCode snippet
type(def)
2.2.3n/aJIT301 μs
8.47x
stat_minus_1
ajv
Code snippetCode snippet
ajv.compile(schema)
8.20.0n/aJIT3 ms
82.45x
stat_minus_1
@sapphire/shapeshift
Code snippetCode snippet
s.object(shape)
5.0.0n/aNone29 μs
1.24x
stat_1
@remix-run/data-schema
Code snippetCode snippet
object(shape)
0.3.1n/aNone8 μs
4.49x
stat_1
@railway-ts/pipelines
Code snippetCode snippet
object(schema)
0.1.29n/aNone804 ns
44.22x
stat_1
@paseri/paseri
Code snippetCode snippet
p.object(shape)
1.9.7161None2 μs
15x
stat_1
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures