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
@paseri/compiler
Code snippetCode snippet
upfetch(url, { schema })
0.7.5109PrecompiledAll errors3 μs
joi
Code snippetCode snippet
upfetch(url, { schema })
18.2.322.46MNoneAll errors4 μs
1.38x
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.024.01MNoneAbort early5 μs
1.48x
stat_minus_1
@paseri/paseri
Code snippetCode snippet
upfetch(url, { schema })
1.9.5119NoneAll errors6 μs
1.79x
stat_minus_1
sury
Code snippetCode snippet
upfetch(url, { schema })
11.0.0-alpha.10297.33KJITAll errors8 μs
2.47x
stat_minus_1
typia
Code snippetCode snippet
// const validate = typia.createValidate<TypiaSchema>();
upfetch(url, { schema: validate })

(Commented code is not benchmarked)

13.1.0312.92KPrecompiledAll errors11 μs
3.4x
stat_minus_1
valibot
Code snippetCode snippet
upfetch(url, { schema })
1.4.215.99MNoneAll errors29 μs
9.08x
stat_minus_1
@railway-ts/pipelines
Code snippetCode snippet
upfetch(url, { schema })
0.1.29226NoneAll errors30 μs
9.46x
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.9824.01MNoneAll errors31 μs
9.81x
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.9824.01MNoneAbort early32 μs
10.13x
stat_minus_1
zod/v3
Code snippetCode snippet
upfetch(url, { schema })
4.4.3245.4MNoneAll errors35 μs
10.87x
stat_minus_1
ata-validator
Code snippetCode snippet
upfetch(url, { schema })
0.21.01.08KJITAll errors43 μs
13.46x
stat_minus_1
zod/mini
Code snippetCode snippet
upfetch(url, { schema })
4.4.3245.4MJITAll errors65 μs
20.38x
stat_minus_1
zod
Code snippetCode snippet
upfetch(url, { schema })
4.4.3245.4MJITAll errors66 μs
20.49x
stat_minus_1
decoders
Code snippetCode snippet
upfetch(url, { schema })
2.9.349.01KNoneAll errors69 μs
21.59x
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.024.01MNoneAll errors72 μs
22.64x
stat_minus_1
arktype
Code snippetCode snippet
upfetch(url, { schema })
2.2.31.37MJITAll errors97 μs
30.22x
stat_minus_1
yup
Code snippetCode snippet
upfetch(url, { schema })
1.7.112.52MNoneAll errors573 μs
179.21x
stat_minus_3
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures