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
@mionjs/run-types
Code snippetCode snippet
const schema = createStandardSchema<MionSchema>();
upfetch(url, { schema })

(Setup code is not benchmarked)

0.20.099PrecompiledAll errors962 ns
effect
Code snippetCode snippet
const standardSchema = Schema.toStandardSchemaV1(schema, { parseOptions: { errors: "first" } });
upfetch(url, { schema: standardSchema });

(Setup code is not benchmarked)

4.1.567.63MNoneAbort early1 μs
1.32x
stat_minus_1
@paseri/compiler
Code snippetCode snippet
upfetch(url, { schema })
0.7.7109PrecompiledAll errors2 μs
2.15x
stat_minus_1
ata-validator
Code snippetCode snippet
upfetch(url, { schema })
1.65.051.07KJITAll errors2 μs
2.18x
stat_minus_1
joi
Code snippetCode snippet
upfetch(url, { schema })
18.3.233.59MNoneAll errors3 μs
2.84x
stat_minus_1
sury
Code snippetCode snippet
upfetch(url, { schema })
11.1.0609.62KJITAll errors3 μs
2.88x
stat_minus_1
zod-compiler (bag + mini)
Code snippetCode snippet
upfetch(url, { schema })
2.0.14186KPrecompiledAll errors4 μs
3.84x
stat_minus_1
zod-compiler (mini)
Code snippetCode snippet
upfetch(url, { schema })
2.0.14186KPrecompiledAll errors4 μs
3.87x
stat_minus_1
zod-compiler
Code snippetCode snippet
upfetch(url, { schema })
2.0.14186KPrecompiledAll errors4 μs
3.89x
stat_minus_1
zod-compiler (bag)
Code snippetCode snippet
upfetch(url, { schema })
2.0.14186KPrecompiledAll errors4 μs
3.9x
stat_minus_1
@paseri/paseri
Code snippetCode snippet
upfetch(url, { schema })
1.9.7136NoneAll errors4 μs
4.05x
stat_minus_1
valibot
Code snippetCode snippet
upfetch(url, { schema })
1.5.035.07MNoneAll errors7 μs
7.23x
stat_minus_1
@remix-run/data-schema
Code snippetCode snippet
upfetch(url, { schema })
1.0.177.58KNoneAll errors8 μs
8.5x
stat_minus_1
zod
Code snippetCode snippet
upfetch(url, { schema })
4.6.7462.8MJITAll errors9 μs
9.86x
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.7462.8MJITAll errors10 μs
9.99x
stat_minus_1
typia
Code snippetCode snippet
const validate = typia.createValidate<TypiaSchema>();
upfetch(url, { schema: validate })

(Setup code is not benchmarked)

15.5.0671.92KPrecompiledAll errors11 μs
11.21x
stat_minus_1
zod/mini
Code snippetCode snippet
upfetch(url, { schema })
4.6.7462.8MJITAll errors13 μs
13.49x
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.7462.8MJITAll errors13 μs
13.51x
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.1.567.63MNoneAll errors14 μs
14.33x
stat_minus_1
@railway-ts/pipelines
Code snippetCode snippet
upfetch(url, { schema })
0.6.02.06KNoneAll errors14 μs
14.41x
stat_minus_1
zod-compiler (compact)
Code snippetCode snippet
upfetch(url, { schema })
2.0.14186KPrecompiledAll errors14 μs
14.8x
stat_minus_1
zod/v3
Code snippetCode snippet
upfetch(url, { schema })
4.6.7462.8MNoneAll errors16 μs
16.65x
stat_minus_1
zod-compiler (compact + mini)
Code snippetCode snippet
upfetch(url, { schema })
2.0.14186KPrecompiledAll errors19 μs
19.5x
stat_minus_1
arktype
Code snippetCode snippet
upfetch(url, { schema })
2.2.103.19MJITAll errors62 μs
64.68x
stat_minus_1
decoders
Code snippetCode snippet
upfetch(url, { schema })
2.13.0107.54KNoneAll errors67 μs
69.61x
stat_minus_1
yup
Code snippetCode snippet
upfetch(url, { schema })
1.7.116.38MNoneAll errors236 μs
245.37x
stat_minus_3
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures