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/wksortOptimizationsError typeMeanarrow_upwardCompare
yup
Code snippetCode snippet
upfetch(url, { schema })
1.7.112.78MNoneAll errors602 μs
arktype
Code snippetCode snippet
upfetch(url, { schema })
2.2.31.81MJITAll errors90 μs
6.67x
stat_1
decoders
Code snippetCode snippet
upfetch(url, { schema })
2.9.331.47KNoneAll errors71 μs
8.52x
stat_1
effect
Code snippetCode snippet
// const standardSchema = Schema.standardSchemaV1(
//   schema, 
//   { errors: "all" }
// );
upfetch(url, { schema: standardSchema });

(Commented code is not benchmarked)

3.22.031.53MNoneAll errors68 μs
8.92x
stat_1
zod-compiler (bag)
Code snippetCode snippet
upfetch(url, { schema })
1.28.086.63KPrecompiledAll errors61 μs
9.83x
stat_1
zod-compiler
Code snippetCode snippet
upfetch(url, { schema })
1.28.086.63KPrecompiledAll errors60 μs
10.04x
stat_1
zod/mini
Code snippetCode snippet
upfetch(url, { schema })
4.4.3272.03MJITAll errors59 μs
10.27x
stat_1
zod
Code snippetCode snippet
upfetch(url, { schema })
4.4.3272.03MJITAll errors56 μs
10.8x
stat_1
zod-compiler (compact)
Code snippetCode snippet
upfetch(url, { schema })
1.28.086.63KPrecompiledAll errors56 μs
10.84x
stat_1
zod/v3
Code snippetCode snippet
upfetch(url, { schema })
4.4.3272.03MNoneAll errors35 μs
17.03x
stat_1
@railway-ts/pipelines
Code snippetCode snippet
upfetch(url, { schema })
0.1.29287NoneAll errors31 μs
19.74x
stat_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.10131.53MNoneAbort early30 μs
19.75x
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.10131.53MNoneAll errors30 μs
19.8x
stat_1
valibot
Code snippetCode snippet
upfetch(url, { schema })
1.4.218.08MNoneAll errors30 μs
20.31x
stat_1
typia
Code snippetCode snippet
// const validate = typia.createValidate<TypiaSchema>();
upfetch(url, { schema: validate })

(Commented code is not benchmarked)

14.0.2338.21KPrecompiledAll errors20 μs
29.85x
stat_1
sury
Code snippetCode snippet
upfetch(url, { schema })
11.0.0-rc.2342.48KJITAll errors9 μs
67.2x
stat_1
@paseri/paseri
Code snippetCode snippet
upfetch(url, { schema })
1.9.7144NoneAll errors6 μs
101.34x
stat_1
effect
Code snippetCode snippet
// const standardSchema = Schema.standardSchemaV1(
//   schema, 
//   { errors: "first" }
// );
upfetch(url, { schema: standardSchema });

(Commented code is not benchmarked)

3.22.031.53MNoneAbort early5 μs
122.82x
stat_1
joi
Code snippetCode snippet
upfetch(url, { schema })
18.2.525.86MNoneAll errors5 μs
125.48x
stat_1
@paseri/compiler
Code snippetCode snippet
upfetch(url, { schema })
0.7.7141PrecompiledAll errors4 μs
167.85x
stat_2
ata-validator
Code snippetCode snippet
upfetch(url, { schema })
1.7.22.33KJITAll errors2 μs
397.34x
stat_3
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures