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

    • 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
errorInvalidcheck_circleValid
Optimizations
flash_offNonecodeJITbuildPrecompiled
Abort early
errorAll errorswarningAbort early
LibrarysortVersionDownloads (/wk)sortOptimizationsError typeMeanarrow_upwardCompare
joi
Code snippetCode snippet
upfetch(url, { schema })
18.2.316.97MNoneAll errors5 μs
effect
Code snippetCode snippet
// const standardSchema = Schema.standardSchemaV1(
//   schema, 
//   { errors: "first" }
// );
upfetch(url, { schema: standardSchema });

(Commented code is not benchmarked)

3.21.417.39MNoneAbort early5 μs
1.13x
stat_minus_1
sury
Code snippetCode snippet
upfetch(url, { schema })
11.0.0-alpha.9199.54KJITAll errors8 μs
1.65x
stat_minus_1
typia
Code snippetCode snippet
// const validate = typia.createValidate<TypiaSchema>();
upfetch(url, { schema: validate })

(Commented code is not benchmarked)

12.1.1292.71KPrecompiledAll errors10 μs
2.3x
stat_minus_1
valibot
Code snippetCode snippet
upfetch(url, { schema })
1.4.213.65MNoneAll errors27 μs
5.94x
stat_minus_1
@railway-ts/pipelines
Code snippetCode snippet
upfetch(url, { schema })
0.1.2937NoneAll errors29 μs
6.39x
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.9317.39MNoneAbort early30 μs
6.59x
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.9317.39MNoneAll errors30 μs
6.61x
stat_minus_1
zod/v3
Code snippetCode snippet
upfetch(url, { schema })
4.4.3210.15MNoneAll errors32 μs
7.12x
stat_minus_1
ata-validator
Code snippetCode snippet
upfetch(url, { schema })
0.21.0399JITAll errors44 μs
9.72x
stat_minus_1
zod
Code snippetCode snippet
upfetch(url, { schema })
4.4.3210.15MJITAll errors54 μs
11.93x
stat_minus_1
zod/mini
Code snippetCode snippet
upfetch(url, { schema })
4.4.3210.15MJITAll errors57 μs
12.42x
stat_minus_1
effect
Code snippetCode snippet
// const standardSchema = Schema.standardSchemaV1(
//   schema, 
//   { errors: "all" }
// );
upfetch(url, { schema: standardSchema });

(Commented code is not benchmarked)

3.21.417.39MNoneAll errors70 μs
15.27x
stat_minus_1
decoders
Code snippetCode snippet
upfetch(url, { schema })
2.9.353.59KNoneAll errors86 μs
18.84x
stat_minus_1
arktype
Code snippetCode snippet
upfetch(url, { schema })
2.2.21.15MJITAll errors88 μs
19.28x
stat_minus_1
yup
Code snippetCode snippet
upfetch(url, { schema })
1.7.19.31MNoneAll errors503 μs
110.18x
stat_minus_3
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser