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

    • article
      Blog
Code styleCode style
Normal styleNormal style
System themeSystem theme
Light themeLight theme
Dark themeDark theme
Expand sidebarExpand sidebar
Benchmarks/CodecCodec
Code styleCode style
Normal styleNormal style
System themeSystem theme
Light themeLight theme
Dark themeDark theme
github
GitHubGitHub
DiscordDiscord

Some schema libraries support two way conversion of data, often referred to as "encoding" and "decoding".

We benchmark the time taken to encode and decode a Date to and from a string (usually an ISO 8601 string, but we don't enforce this).

Copy to clipboardCopy to clipboard
import * as z from "zod"; const dateFromString = z.codec(z.iso.datetime(), z.date(), { encode: (date) => date.toISOString(), decode: (str) => new Date(str), }); dateFromString.encode(new Date(0)); // "1970-01-01T00:00:00.000Z" dateFromString.decode("1970-01-01T00:00:00.000Z"); // Date
format_quoteInvalid data

We don't benchmark codecs with invalid data, as many libraries require the input to be correctly typed before passing it to the codec.

Optimizations
flash_offNonecodeJITbuildPrecompiled
database_off

No results found

Try a different combination of filters

Created by eskimojo for Open Circle