Skip to content

typescript-tutorial/data-validation-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

data-validation-benchmark

How to run the benchmark

Clone the Repository

Open your terminal and run:

git clone git@github.com:typescript-tutorial/data-validation-benchmark.git

Install Dependencies

Make sure you have Node.js and npm installed. Then run:

npm install

Run the Benchmark

Run the Benchmark with typescript directly:

npx tsx ./src/app.ts

Benchmark Result:

Library Ops/sec RME (%) Samples Size (min+gz) Relative Speed (vs fastest) Note
Ajv 16,135,745.76 0.22% 98 ~114 KB 🏆 1.00× (fastest) Maximum throughput, heavier bundle
xvalidators 1,837,148.5 0.18% 98 ~3.8 KB ~8.8× slower Small + fast for edge/API
Zod 1,286,858.66 1.21% 97 ~25 KB ~12.5× slower Medium Size + Good Performance
Valibot 1,200,122.07 0.21% 98 ~4 KB ~13.4× slower Small Size + Good Performance
Joi 382,176.91 0.26% 98 ~80 KB ~42.2× slower Heavy Size + Slow Performance
Yup 139,092.61 0.25% 97 ~28 KB ~116× slower Medium Size + Very Slow Performance

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published