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

    • article
      Blog
Code styleCode style
Normal styleNormal style
System themeSystem theme
Light themeLight theme
Dark themeDark theme
Expand sidebarExpand sidebar
Benchmarks/Standard SchemaStandard Schema
Code styleCode style
Normal styleNormal style
System themeSystem theme
Light themeLight theme
Dark themeDark theme
github
GitHubGitHub
DiscordDiscord

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
errorInvalidcheck_circleValid
Optimizations
flash_offNonecodeJITbuildPrecompiled
Abort early
errorAll errorswarningAbort early
Libraryarrow_upwardVersionDownloads (/wk)sortOptimizationsError typeMeansortCompare
@railway-ts/pipelines
Code snippetCode snippet
upfetch(url, { schema })
0.1.2734NoneAll errors29 μs
arktype
Code snippetCode snippet
upfetch(url, { schema })
2.2.0885.45KJITAll errors89 μs
3.04x
stat_minus_1
ata-validator
Code snippetCode snippet
upfetch(url, { schema })
0.8.0728JITAll errors8 μs
3.49x
stat_1
decoders
Code snippetCode snippet
upfetch(url, { schema })
2.9.338.55KNoneAll errors94 μs
3.2x
stat_minus_1
effect
Code snippetCode snippet
// const standardSchema = Schema.standardSchemaV1(
//   schema, 
//   { errors: "first" }
// );
upfetch(url, { schema: standardSchema });

(Commented code is not benchmarked)

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

(Commented code is not benchmarked)

3.21.09.44MNoneAll errors71 μs
2.4x
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.469.44MNoneAbort early30 μs
1.03x
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.469.44MNoneAll errors30 μs
1.04x
stat_minus_1
joi
Code snippetCode snippet
upfetch(url, { schema })
18.1.218.74MNoneAll errors5 μs
6.43x
stat_2
sury
Code snippetCode snippet
upfetch(url, { schema })
11.0.0-alpha.4146.04KJITAll errors8 μs
3.74x
stat_1
typia
Code snippetCode snippet
// const validate = typia.createValidate<TypiaSchema>();
upfetch(url, { schema: validate })

(Commented code is not benchmarked)

12.0.2259.06KPrecompiledAll errors10 μs
2.84x
stat_1
valibot
Code snippetCode snippet
upfetch(url, { schema })
1.3.17.93MNoneAll errors27 μs
1.09x
stat_1
yup
Code snippetCode snippet
upfetch(url, { schema })
1.7.110.79MNoneAll errors497 μs
16.94x
stat_minus_3
zod
Code snippetCode snippet
upfetch(url, { schema })
4.3.6151.14MJITAll errors63 μs
2.14x
stat_minus_1
zod/mini
Code snippetCode snippet
upfetch(url, { schema })
4.3.6151.14MJITAll errors64 μs
2.17x
stat_minus_1
zod/v3
Code snippetCode snippet
upfetch(url, { schema })
4.3.6151.14MNoneAll errors33 μs
1.11x
stat_minus_1
Created by eskimojo for Open Circle