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
    • 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.7110PrecompiledAll errors3 μs
joi
Code snippetCode snippet
upfetch(url, { schema })
18.2.9n/aNoneAll errors4 μs
1.32x
stat_minus_1
ata-validator
Code snippetCode snippet
upfetch(url, { schema })
1.21.0n/aJITAll errors5 μs
1.59x
stat_minus_1
@paseri/paseri
Code snippetCode snippet
upfetch(url, { schema })
1.9.7136NoneAll errors6 μs
1.85x
stat_minus_1
sury
Code snippetCode snippet
upfetch(url, { schema })
11.0.0n/aJITAll errors8 μs
2.54x
stat_minus_1
valibot
Code snippetCode snippet
upfetch(url, { schema })
1.5.0n/aNoneAll errors11 μs
3.44x
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 errors15 μs
4.73x
stat_minus_1
zod
Code snippetCode snippet
upfetch(url, { schema })
4.6.5n/aJITAll errors15 μs
4.76x
stat_minus_1
zod-compiler (compact)
Code snippetCode snippet
upfetch(url, { schema })
2.0.4n/aPrecompiledAll errors20 μs
6.47x
stat_minus_1
@remix-run/data-schema
Code snippetCode snippet
upfetch(url, { schema })
0.3.0n/aNoneAll errors21 μs
6.75x
stat_minus_1
zod/mini
Code snippetCode snippet
upfetch(url, { schema })
4.6.5n/aJITAll errors21 μs
6.76x
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 errors22 μs
6.82x
stat_minus_1
typia
Code snippetCode snippet
const validate = typia.createValidate<TypiaSchema>();
upfetch(url, { schema: validate })

(Setup code is not benchmarked)

14.0.6n/aPrecompiledAll errors22 μs
6.99x
stat_minus_1
effect@rc
Code snippetCode snippet
const standardSchema = Schema.toStandardSchemaV1(
  schema,
  { parseOptions: { errors: "all" } }
);
upfetch(url, { schema: standardSchema });

(Setup code is not benchmarked)

4.0.0-rc.112n/aNoneAll errors25 μs
7.8x
stat_minus_1
zod-compiler (bag)
Code snippetCode snippet
upfetch(url, { schema })
2.0.4n/aPrecompiledAll errors25 μs
8.02x
stat_minus_1
zod-compiler
Code snippetCode snippet
upfetch(url, { schema })
2.0.4n/aPrecompiledAll errors26 μs
8.19x
stat_minus_1
@railway-ts/pipelines
Code snippetCode snippet
upfetch(url, { schema })
0.1.29n/aNoneAll errors31 μs
9.82x
stat_minus_1
zod/v3
Code snippetCode snippet
upfetch(url, { schema })
4.6.5n/aNoneAll errors35 μs
11.19x
stat_minus_1
decoders
Code snippetCode snippet
upfetch(url, { schema })
2.9.3n/aNoneAll errors59 μs
18.61x
stat_minus_1
effect
Code snippetCode snippet
const standardSchema = Schema.standardSchemaV1(schema, { errors: "all" });
upfetch(url, { schema: standardSchema });

(Setup code is not benchmarked)

3.22.2n/aNoneAll errors68 μs
21.57x
stat_minus_1
arktype
Code snippetCode snippet
upfetch(url, { schema })
2.2.3n/aJITAll errors101 μs
31.96x
stat_minus_1
yup
Code snippetCode snippet
upfetch(url, { schema })
1.7.1n/aNoneAll errors640 μs
202.58x
stat_minus_3
Created by eskimojo for Open Circle

Preferences

Style
Theme
NPM browser
Code ligatures