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
ata-validator
Code snippetCode snippet
upfetch(url, { schema })
1.6.21.78KJITAll errors2 μs
@paseri/compiler
Code snippetCode snippet
upfetch(url, { schema })
0.7.7153PrecompiledAll errors3 μs
2.26x
stat_minus_1
joi
Code snippetCode snippet
upfetch(url, { schema })
18.2.524.98MNoneAll errors5 μs
3x
stat_minus_1
effect
Code snippetCode snippet
// const standardSchema = Schema.standardSchemaV1(
//   schema, 
//   { errors: "first" }
// );
upfetch(url, { schema: standardSchema });

(Commented code is not benchmarked)

3.22.030.12MNoneAbort early5 μs
3.23x
stat_minus_1
@paseri/paseri
Code snippetCode snippet
upfetch(url, { schema })
1.9.7151NoneAll errors6 μs
3.82x
stat_minus_1
sury
Code snippetCode snippet
upfetch(url, { schema })
11.0.0-rc.1305.51KJITAll errors9 μs
5.86x
stat_minus_1
typia
Code snippetCode snippet
// const validate = typia.createValidate<TypiaSchema>();
upfetch(url, { schema: validate })

(Commented code is not benchmarked)

14.0.0329.74KPrecompiledAll errors21 μs
13.78x
stat_minus_1
valibot
Code snippetCode snippet
upfetch(url, { schema })
1.4.217.67MNoneAll errors28 μs
18.17x
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.10130.12MNoneAbort early29 μs
19.23x
stat_minus_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.10130.12MNoneAll errors29 μs
19.25x
stat_minus_1
@railway-ts/pipelines
Code snippetCode snippet
upfetch(url, { schema })
0.1.29265NoneAll errors30 μs
20.07x
stat_minus_1
zod/v3
Code snippetCode snippet
upfetch(url, { schema })
4.4.3265.74MNoneAll errors35 μs
22.83x
stat_minus_1
zod-compiler (compact)
Code snippetCode snippet
upfetch(url, { schema })
1.27.068.22KPrecompiledAll errors55 μs
36.09x
stat_minus_1
zod
Code snippetCode snippet
upfetch(url, { schema })
4.4.3265.74MJITAll errors56 μs
36.84x
stat_minus_1
zod/mini
Code snippetCode snippet
upfetch(url, { schema })
4.4.3265.74MJITAll errors59 μs
38.57x
stat_minus_1
zod-compiler
Code snippetCode snippet
upfetch(url, { schema })
1.27.068.22KPrecompiledAll errors59 μs
38.63x
stat_minus_1
zod-compiler (bag)
Code snippetCode snippet
upfetch(url, { schema })
1.27.068.22KPrecompiledAll errors60 μs
39.36x
stat_minus_1
effect
Code snippetCode snippet
// const standardSchema = Schema.standardSchemaV1(
//   schema, 
//   { errors: "all" }
// );
upfetch(url, { schema: standardSchema });

(Commented code is not benchmarked)

3.22.030.12MNoneAll errors64 μs
42.09x
stat_minus_1
decoders
Code snippetCode snippet
upfetch(url, { schema })
2.9.328.35KNoneAll errors67 μs
44.44x
stat_minus_1
arktype
Code snippetCode snippet
upfetch(url, { schema })
2.2.31.7MJITAll errors89 μs
58.38x
stat_minus_1
yup
Code snippetCode snippet
upfetch(url, { schema })
1.7.112.55MNoneAll errors597 μs
393.37x
stat_minus_3
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures