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
    • assignment_turned_in
      TypeScript

  • 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, });
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
ata-validator
Code snippetCode snippet
upfetch(url, { schema })
1.46.1n/aJITAll errors3 μs
@paseri/compiler
Code snippetCode snippet
upfetch(url, { schema })
0.7.7924PrecompiledAll errors3 μs
1.02x
stat_minus_1
sury
Code snippetCode snippet
upfetch(url, { schema })
11.0.0n/aJITAll errors3 μs
1.11x
stat_minus_1
joi
Code snippetCode snippet
upfetch(url, { schema })
18.2.9n/aNoneAll errors4 μs
1.25x
stat_minus_1
zod-compiler (bag)
Code snippetCode snippet
upfetch(url, { schema })
2.0.7n/aPrecompiledAll errors5 μs
1.59x
stat_minus_1
@paseri/paseri
Code snippetCode snippet
upfetch(url, { schema })
1.9.7932NoneAll errors5 μs
1.59x
stat_minus_1
zod-compiler
Code snippetCode snippet
upfetch(url, { schema })
2.0.7n/aPrecompiledAll errors5 μs
1.61x
stat_minus_1
valibot
Code snippetCode snippet
upfetch(url, { schema })
1.5.0n/aNoneAll errors8 μs
2.94x
stat_minus_1
@remix-run/data-schema
Code snippetCode snippet
upfetch(url, { schema })
1.0.0n/aNoneAll errors10 μs
3.45x
stat_minus_1
zod (compile)
Code snippetCode snippet
const compiledSchema = z.compile(schema, { strict: true });
upfetch(url, { schema: compiledSchema })

(Setup code is not benchmarked)

4.6.5n/aJITAll errors12 μs
4.06x
stat_minus_1
zod
Code snippetCode snippet
upfetch(url, { schema })
4.6.5n/aJITAll errors12 μs
4.13x
stat_minus_1
typia
Code snippetCode snippet
const validate = typia.createValidate<TypiaSchema>();
upfetch(url, { schema: validate })

(Setup code is not benchmarked)

15.1.0n/aPrecompiledAll errors15 μs
5.26x
stat_minus_1
@railway-ts/pipelines
Code snippetCode snippet
upfetch(url, { schema })
0.1.29n/aNoneAll errors16 μs
5.71x
stat_minus_1
zod-compiler (compact)
Code snippetCode snippet
upfetch(url, { schema })
2.0.7n/aPrecompiledAll errors16 μs
5.74x
stat_minus_1
zod/mini (compile)
Code snippetCode snippet
const compiledSchema = z.compile(schema, { strict: true });
upfetch(url, { schema: compiledSchema })

(Setup code is not benchmarked)

4.6.5n/aJITAll errors16 μs
5.77x
stat_minus_1
zod/mini
Code snippetCode snippet
upfetch(url, { schema })
4.6.5n/aJITAll errors17 μs
5.93x
stat_minus_1
effect
Code snippetCode snippet
const standardSchema = Schema.toStandardSchemaV1(
  schema,
  { parseOptions: { errors: "all" } }
);
upfetch(url, { schema: standardSchema });

(Setup code is not benchmarked)

4.0.1n/aNoneAll errors17 μs
6.05x
stat_minus_1
effect
Code snippetCode snippet
const standardSchema = Schema.toStandardSchemaV1(schema, { parseOptions: { errors: "first" } });
upfetch(url, { schema: standardSchema });

(Setup code is not benchmarked)

4.0.1n/aNoneAbort early17 μs
6.06x
stat_minus_1
zod/v3
Code snippetCode snippet
upfetch(url, { schema })
4.6.5n/aNoneAll errors20 μs
7x
stat_minus_1
arktype
Code snippetCode snippet
upfetch(url, { schema })
2.2.7n/aJITAll errors71 μs
24.78x
stat_minus_1
decoders
Code snippetCode snippet
upfetch(url, { schema })
2.12.2n/aNoneAll errors92 μs
32.21x
stat_minus_1
yup
Code snippetCode snippet
upfetch(url, { schema })
1.7.1n/aNoneAll errors293 μs
102.93x
stat_minus_3
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures