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
@paseri/paseri
Code snippetCode snippet
upfetch(url, { schema })
1.9.7158NoneAll errors6 μs
@paseri/compiler
Code snippetCode snippet
upfetch(url, { schema })
0.7.7141PrecompiledAll errors4 μs
1.66x
stat_1
@railway-ts/pipelines
Code snippetCode snippet
upfetch(url, { schema })
0.1.29n/aNoneAll errors31 μs
5.13x
stat_minus_1
arktype
Code snippetCode snippet
upfetch(url, { schema })
2.2.3n/aJITAll errors90 μs
15.18x
stat_minus_1
ata-validator
Code snippetCode snippet
upfetch(url, { schema })
1.7.2n/aJITAll errors2 μs
3.92x
stat_1
decoders
Code snippetCode snippet
upfetch(url, { schema })
2.9.3n/aNoneAll errors71 μs
11.9x
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.0n/aNoneAbort early5 μs
1.21x
stat_1
effect
Code snippetCode snippet
// const standardSchema = Schema.standardSchemaV1(
//   schema, 
//   { errors: "all" }
// );
upfetch(url, { schema: standardSchema });

(Commented code is not benchmarked)

3.22.0n/aNoneAll errors68 μs
11.37x
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.101n/aNoneAll errors30 μs
5.12x
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.101n/aNoneAbort early30 μs
5.13x
stat_minus_1
joi
Code snippetCode snippet
upfetch(url, { schema })
18.2.5n/aNoneAll errors5 μs
1.24x
stat_1
sury
Code snippetCode snippet
upfetch(url, { schema })
11.0.0-rc.2n/aJITAll errors9 μs
1.51x
stat_minus_1
typia
Code snippetCode snippet
// const validate = typia.createValidate<TypiaSchema>();
upfetch(url, { schema: validate })

(Commented code is not benchmarked)

14.0.2n/aPrecompiledAll errors20 μs
3.4x
stat_minus_1
valibot
Code snippetCode snippet
upfetch(url, { schema })
1.4.2n/aNoneAll errors30 μs
4.99x
stat_minus_1
yup
Code snippetCode snippet
upfetch(url, { schema })
1.7.1n/aNoneAll errors602 μs
101.34x
stat_minus_3
zod
Code snippetCode snippet
upfetch(url, { schema })
4.4.3n/aJITAll errors56 μs
9.38x
stat_minus_1
zod-compiler
Code snippetCode snippet
upfetch(url, { schema })
1.28.0n/aPrecompiledAll errors60 μs
10.09x
stat_minus_1
zod-compiler (bag)
Code snippetCode snippet
upfetch(url, { schema })
1.28.0n/aPrecompiledAll errors61 μs
10.31x
stat_minus_1
zod-compiler (compact)
Code snippetCode snippet
upfetch(url, { schema })
1.28.0n/aPrecompiledAll errors56 μs
9.35x
stat_minus_1
zod/mini
Code snippetCode snippet
upfetch(url, { schema })
4.4.3n/aJITAll errors59 μs
9.87x
stat_minus_1
zod/v3
Code snippetCode snippet
upfetch(url, { schema })
4.4.3n/aNoneAll errors35 μs
5.95x
stat_minus_1
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures