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.7687PrecompiledAll errors3 μs
ata-validator
Code snippetCode snippet
upfetch(url, { schema })
1.58.0n/aJITAll errors3 μs
1x
stat_minus_1
sury
Code snippetCode snippet
upfetch(url, { schema })
11.0.0269.13KJITAll errors4 μs
1.23x
stat_minus_1
joi
Code snippetCode snippet
upfetch(url, { schema })
18.3.015.74MNoneAll errors4 μs
1.29x
stat_minus_1
@paseri/paseri
Code snippetCode snippet
upfetch(url, { schema })
1.9.7750NoneAll errors6 μs
1.73x
stat_minus_1
zod-compiler (bag)
Code snippetCode snippet
upfetch(url, { schema })
2.0.740.31KPrecompiledAll errors6 μs
1.83x
stat_minus_1
zod-compiler
Code snippetCode snippet
upfetch(url, { schema })
2.0.740.31KPrecompiledAll errors6 μs
1.89x
stat_minus_1
valibot
Code snippetCode snippet
upfetch(url, { schema })
1.5.014.44MNoneAll errors11 μs
3.3x
stat_minus_1
@remix-run/data-schema
Code snippetCode snippet
upfetch(url, { schema })
1.0.032.3KNoneAll errors13 μs
3.86x
stat_minus_1
zod
Code snippetCode snippet
upfetch(url, { schema })
4.6.7207.05MJITAll errors15 μs
4.37x
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.7207.05MJITAll errors15 μs
4.47x
stat_minus_1
typia
Code snippetCode snippet
const validate = typia.createValidate<TypiaSchema>();
upfetch(url, { schema: validate })

(Setup code is not benchmarked)

15.1.0211.41KPrecompiledAll errors19 μs
5.71x
stat_minus_1
zod/mini
Code snippetCode snippet
upfetch(url, { schema })
4.6.7207.05MJITAll errors22 μs
6.49x
stat_minus_1
@railway-ts/pipelines
Code snippetCode snippet
upfetch(url, { schema })
0.1.2914NoneAll errors22 μs
6.53x
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.7207.05MJITAll errors22 μs
6.55x
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.531.55MNoneAbort early23 μs
6.72x
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.531.55MNoneAll errors23 μs
6.83x
stat_minus_1
zod-compiler (compact)
Code snippetCode snippet
upfetch(url, { schema })
2.0.740.31KPrecompiledAll errors23 μs
6.91x
stat_minus_1
zod/v3
Code snippetCode snippet
upfetch(url, { schema })
4.6.7207.05MNoneAll errors27 μs
8.15x
stat_minus_1
arktype
Code snippetCode snippet
upfetch(url, { schema })
2.2.91.45MJITAll errors100 μs
29.72x
stat_minus_1
decoders
Code snippetCode snippet
upfetch(url, { schema })
2.13.0n/aNoneAll errors102 μs
30.5x
stat_minus_1
yup
Code snippetCode snippet
upfetch(url, { schema })
1.7.17.45MNoneAll errors414 μs
123.55x
stat_minus_3
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures