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
@paseri/compiler
Code snippetCode snippet
upfetch(url, { schema })
0.7.71.03KPrecompiledAll errors3 μs
ata-validator
Code snippetCode snippet
upfetch(url, { schema })
1.51.05.24KJITAll errors3 μs
1.08x
stat_minus_1
sury
Code snippetCode snippet
upfetch(url, { schema })
11.0.0486.22KJITAll errors4 μs
1.27x
stat_minus_1
joi
Code snippetCode snippet
upfetch(url, { schema })
18.2.925.94MNoneAll errors4 μs
1.34x
stat_minus_1
@paseri/paseri
Code snippetCode snippet
upfetch(url, { schema })
1.9.71.04KNoneAll errors6 μs
1.76x
stat_minus_1
zod-compiler (bag)
Code snippetCode snippet
upfetch(url, { schema })
2.0.764.09KPrecompiledAll errors6 μs
1.93x
stat_minus_1
zod-compiler
Code snippetCode snippet
upfetch(url, { schema })
2.0.764.09KPrecompiledAll errors6 μs
1.94x
stat_minus_1
valibot
Code snippetCode snippet
upfetch(url, { schema })
1.5.0n/aNoneAll errors11 μs
3.43x
stat_minus_1
@remix-run/data-schema
Code snippetCode snippet
upfetch(url, { schema })
1.0.0n/aNoneAll errors13 μs
4.02x
stat_minus_1
zod
Code snippetCode snippet
upfetch(url, { schema })
4.6.5346.1MJITAll errors15 μs
4.58x
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.5346.1MJITAll errors15 μs
4.65x
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 errors20 μs
6.34x
stat_minus_1
zod/mini
Code snippetCode snippet
upfetch(url, { schema })
4.6.5346.1MJITAll errors21 μs
6.59x
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.5346.1MJITAll errors21 μs
6.62x
stat_minus_1
@railway-ts/pipelines
Code snippetCode snippet
upfetch(url, { schema })
0.1.2994NoneAll errors21 μs
6.74x
stat_minus_1
zod-compiler (compact)
Code snippetCode snippet
upfetch(url, { schema })
2.0.764.09KPrecompiledAll errors21 μs
6.75x
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.2n/aNoneAll errors22 μs
7.04x
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.2n/aNoneAbort early23 μs
7.14x
stat_minus_1
zod/v3
Code snippetCode snippet
upfetch(url, { schema })
4.6.5346.1MNoneAll errors27 μs
8.61x
stat_minus_1
decoders
Code snippetCode snippet
upfetch(url, { schema })
2.12.235.43KNoneAll errors96 μs
30.19x
stat_minus_1
arktype
Code snippetCode snippet
upfetch(url, { schema })
2.2.8n/aJITAll errors100 μs
31.36x
stat_minus_1
yup
Code snippetCode snippet
upfetch(url, { schema })
1.7.112.82MNoneAll errors416 μs
130.94x
stat_minus_3
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures