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

    • deployed_code
      Libraries

    • article
      Blog
Expand sidebarExpand sidebar
Benchmarks/JSON Schema/JSON to SchemaJSON to Schema
github
GitHubGitHub
DiscordDiscord
PreferencesPreferences

Some libraries can convert a JSON Schema back into a library schema at runtime, which is useful when you have an existing JSON Schema and want to validate against it using a typed library.

We benchmark each library against the same input:

Copy to clipboardCopy to clipboard
const jsonSchema = { type: "object", properties: { id: { type: "number" }, name: { type: "string" }, price: { type: "string" } }, required: ["id", "name", "price"], }; const schema = z.fromJSONSchema(jsonSchema);
LibrarysortVersiondownload/wkarrow_upwardMeansortCompare
sury
Code snippetCode snippet
S.fromJSONSchema(jsonSchema)
11.0.0-rc.0323.06K5 μs
arktype
Code snippetCode snippet
jsonSchemaToType(jsonSchema)
2.2.31.4M172 μs
33.62x
stat_minus_3
zod
Code snippetCode snippet
z.fromJSONSchema(jsonSchema)
4.4.3253.96M79 μs
15.39x
stat_minus_2
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures