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
@paseri/compiler
Code snippetCode snippet
upfetch(url, { schema })
0.7.7123PrecompiledAll errors3 μs
typia
Code snippetCode snippet
// const validate = typia.createValidate<TypiaSchema>();
upfetch(url, { schema: validate })

(Commented code is not benchmarked)

14.0.0n/aPrecompiledAll errors20 μs
6.3x
stat_minus_1
zod-compiler (compact)
Code snippetCode snippet
upfetch(url, { schema })
1.27.0n/aPrecompiledAll errors61 μs
18.97x
stat_minus_3
zod-compiler
Code snippetCode snippet
upfetch(url, { schema })
1.27.0n/aPrecompiledAll errors67 μs
20.84x
stat_minus_3
zod-compiler (bag)
Code snippetCode snippet
upfetch(url, { schema })
1.27.0n/aPrecompiledAll errors67 μs
20.89x
stat_minus_3
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures