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/Standard SchemaStandard Schema
github
GitHubGitHub
DiscordDiscord
PreferencesPreferences

Many libraries implement the Standard Schema interface, which allows many other libraries to accept them without needing to specialise for each library.

Copy to clipboardCopy to clipboard
import { personSchema } from "./schemas"; const person = await upfetch(url, { schema: personSchema });

We benchmark the time taken to parse using a standard schema.

infoInfo

Some libraries require an adapter before they can be used as a standard schema. The time to convert the schema is not measured, only the time to parse using it.

Data
  • errorInvalid
  • check_circleValid
Optimizations
  • flash_offNone
  • codeJIT
  • buildPrecompiled
Abort early
  • errorAll errors
  • warningAbort early
LibrarysortVersiondownload/wkarrow_upwardOptimizationsError typeMeansortCompare
zod
Code snippetCode snippet
upfetch(url, { schema })
4.4.3223.55MJITAll errors66 μs
zod/mini
Code snippetCode snippet
upfetch(url, { schema })
4.4.3223.55MJITAll errors66 μs
1.01x
stat_minus_1
zod/v3
Code snippetCode snippet
upfetch(url, { schema })
4.4.3223.55MNoneAll errors37 μs
1.79x
stat_1
effect
Code snippetCode snippet
// const standardSchema = Schema.standardSchemaV1(
//   schema, 
//   { errors: "first" }
// );
upfetch(url, { schema: standardSchema });

(Commented code is not benchmarked)

3.22.024.3MNoneAbort early5 μs
13.82x
stat_1
effect
Code snippetCode snippet
// const standardSchema = Schema.standardSchemaV1(
//   schema, 
//   { errors: "all" }
// );
upfetch(url, { schema: standardSchema });

(Commented code is not benchmarked)

3.22.024.3MNoneAll errors69 μs
1.05x
stat_minus_1
effect@beta
Code snippetCode snippet
// const standardSchema = Schema.toStandardSchemaV1(
//   schema, 
//   { parseOptions: { errors: "first" } }
// );
upfetch(url, { schema: standardSchema });

(Commented code is not benchmarked)

4.0.0-beta.10124.3MNoneAbort early32 μs
2.08x
stat_1
effect@beta
Code snippetCode snippet
// const standardSchema = Schema.toStandardSchemaV1(
//   schema, 
//   { parseOptions: { errors: "all" } }
// );
upfetch(url, { schema: standardSchema });

(Commented code is not benchmarked)

4.0.0-beta.10124.3MNoneAll errors32 μs
2.07x
stat_1
joi
Code snippetCode snippet
upfetch(url, { schema })
18.2.320.46MNoneAll errors4 μs
14.87x
stat_2
valibot
Code snippetCode snippet
upfetch(url, { schema })
1.4.214.88MNoneAll errors29 μs
2.24x
stat_1
yup
Code snippetCode snippet
upfetch(url, { schema })
1.7.110.52MNoneAll errors634 μs
9.63x
stat_minus_1
arktype
Code snippetCode snippet
upfetch(url, { schema })
2.2.31.4MJITAll errors97 μs
1.47x
stat_minus_1
typia
Code snippetCode snippet
// const validate = typia.createValidate<TypiaSchema>();
upfetch(url, { schema: validate })

(Commented code is not benchmarked)

14.0.0271.05KPrecompiledAll errors20 μs
3.25x
stat_1
sury
Code snippetCode snippet
upfetch(url, { schema })
11.0.0-rc.1240.68KJITAll errors9 μs
7.26x
stat_1
zod-compiler
Code snippetCode snippet
upfetch(url, { schema })
1.27.031.11KPrecompiledAll errors67 μs
1.02x
stat_minus_1
zod-compiler (bag)
Code snippetCode snippet
upfetch(url, { schema })
1.27.031.11KPrecompiledAll errors67 μs
1.02x
stat_minus_1
zod-compiler (compact)
Code snippetCode snippet
upfetch(url, { schema })
1.27.031.11KPrecompiledAll errors61 μs
1.08x
stat_1
decoders
Code snippetCode snippet
upfetch(url, { schema })
2.9.324.27KNoneAll errors68 μs
1.03x
stat_minus_1
ata-validator
Code snippetCode snippet
upfetch(url, { schema })
1.6.11.06KJITAll errors2 μs
43.03x
stat_3
@paseri/paseri
Code snippetCode snippet
upfetch(url, { schema })
1.9.7172NoneAll errors6 μs
11.6x
stat_1
@paseri/compiler
Code snippetCode snippet
upfetch(url, { schema })
0.7.7123PrecompiledAll errors3 μs
20.44x
stat_2
@railway-ts/pipelines
Code snippetCode snippet
upfetch(url, { schema })
0.1.29123NoneAll errors31 μs
2.1x
stat_1
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures