gitwtfhub

wtf is typescript-runtime-type-benchmarks?

ianstormtaylor/typescript-runtime-type-benchmarks — explained in plain English

Analysis updated 2026-08-14 · repo last pushed 2021-01-12

Audience · developerComplexity · 2/5DormantSetup · easy

TL;DR

Benchmarks 19 popular TypeScript runtime validation libraries (like zod, yup, and io-ts) against each other so you can pick the fastest one for validating incoming data in your app.

Mindmap

mindmap
  root((repo))
    What it does
      Compares 19 validation libraries
      Measures type-check speed
      Tests across Node versions
    Inputs
      Sample data objects
      Expected type schemas
    Outputs
      Bar graph charts
      JSON and CSV files
    Use cases
      Pick fastest validator
      Compare Node version perf
      Lower server latency
    Audience
      TypeScript developers
      API and server builders
    Limitations
      Speed only not ease of use
      No bundle size comparison

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Compare validation library speeds to pick the fastest one for a high-traffic API server.

REASON 2

Check how validation performance changes across different Node.js versions before upgrading.

REASON 3

Download benchmark results as CSV or JSON to analyze raw numbers in your own tools.

REASON 4

Review bar graphs to quickly eyeball which validators are fastest and slowest.

What's in the stack?

TypeScriptNode.jszodyupio-tssuperstruct

How it stacks up

ianstormtaylor/typescript-runtime-type-benchmarks000madz000/rfid-attendance00kaku/gallery-slider-block
LanguageTypeScriptJavaScript
Last pushed2021-01-122024-07-222021-05-19
MaintenanceDormantDormantDormant
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

No special infrastructure needed, results are viewable directly in the README as charts and downloadable files.

The license is not specified in the repository documentation, so it is unclear what permissions you have for using this code.

Wtf does this do

When you build an app in TypeScript, you often receive data from external sources, API responses, user input, config files, and you need to check that the data looks the way you expect before trusting it. A whole category of libraries exists to do this kind of runtime validation, and this repo simply benchmarks them against each other so you can pick the fastest one. The project compares 19 popular validation libraries, including well-known options like zod, yup, io-ts, and superstruct. It runs a standard test: given a piece of data, how quickly can each library confirm whether it matches the expected type? If you pass a number where a string was expected, the validator should catch that. The results are broken down by Node.js version (10 through 14), so you can see how performance shifts across different runtime environments. A developer building a server or API in TypeScript would use this when deciding which validation library to adopt. If your app validates thousands of requests per second, a faster library directly translates to lower latency and lower infrastructure costs. The benchmarks also include a "sans outliers" view that removes two exceptionally fast packages (marshal and ts-json-validator) because their performance makes the rest hard to compare visually. The README doesn't go into detail about the specific test data or methodology beyond the basic type-check scenario. Results are provided as bar graphs, JSON, and CSV files, so you can eyeball the chart or dig into raw numbers. One tradeoff worth noting: the benchmarks only measure speed, not ease of use, bundle size, or developer experience, all of which matter when choosing a library for a real project.

Yoink these prompts

Prompt 1
I need to validate thousands of API requests per second in a TypeScript server. Based on the typescript-runtime-type-benchmarks repo, which validation library should I choose for the lowest latency?
Prompt 2
Show me a comparison of zod vs yup vs io-ts runtime validation speed from the typescript-runtime-type-benchmarks project and explain which is faster across Node versions.
Prompt 3
I am building a TypeScript app that receives untrusted JSON data from external APIs. Using the typescript-runtime-type-benchmarks results, help me pick a validation library that balances speed with being well-known and maintained.
Prompt 4
What are the 19 validation libraries benchmarked in typescript-runtime-type-benchmarks and which ones are the fastest according to the results?

Frequently asked questions

wtf is typescript-runtime-type-benchmarks?

Benchmarks 19 popular TypeScript runtime validation libraries (like zod, yup, and io-ts) against each other so you can pick the fastest one for validating incoming data in your app.

Is typescript-runtime-type-benchmarks actively maintained?

Dormant — no commits in 2+ years (last push 2021-01-12).

What license does typescript-runtime-type-benchmarks use?

The license is not specified in the repository documentation, so it is unclear what permissions you have for using this code.

How hard is typescript-runtime-type-benchmarks to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is typescript-runtime-type-benchmarks for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.