Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(benchmarks): add ajv and joi benchmark libraries #8

Closed
wants to merge 1 commit into from

Conversation

lolo32
Copy link
Contributor

@lolo32 lolo32 commented Jun 22, 2023

🔗 Linked issue

#7

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

I just added Ajv and Joi to the benchmarks to the four benchmarks. Because I'm not an expert, the implementation could, maybe, be optimized, but it allow to have some data to compare.

Here are the data from my computer:

===============================
Benchmarking with flat object
===============================
Vine x 10,021,081 ops/sec ±1.03% (88 runs sampled)
Zod x 1,211,267 ops/sec ±1.18% (87 runs sampled)
Yup x 435,075 ops/sec ±0.29% (89 runs sampled)
Joi x 1,809,984 ops/sec ±0.31% (84 runs sampled)
Ajv x 11,133,646 ops/sec ±0.34% (89 runs sampled)
Fastest is Ajv
=================================
Benchmarking with nested object
=================================
Vine x 8,788,298 ops/sec ±0.59% (86 runs sampled)
Zod x 574,303 ops/sec ±1.30% (84 runs sampled)
Yup x 195,536 ops/sec ±0.23% (87 runs sampled)
Joi x 887,795 ops/sec ±0.16% (90 runs sampled)
Ajv x 10,540,140 ops/sec ±0.64% (82 runs sampled)
Fastest is Ajv
======================
Benchmarking arrays
======================
Vine x 7,291,018 ops/sec ±0.49% (85 runs sampled)
Zod x 408,202 ops/sec ±1.08% (82 runs sampled)
Yup x 117,125 ops/sec ±0.35% (89 runs sampled)
Joi x 610,687 ops/sec ±0.20% (91 runs sampled)
Ajv x 9,818,757 ops/sec ±0.21% (90 runs sampled)
Fastest is Ajv
=======================
Benchmarking unions
=======================
Vine x 7,855,896 ops/sec ±0.50% (88 runs sampled)
Zod x 176,750 ops/sec ±0.40% (84 runs sampled)
Joi x 736,976 ops/sec ±0.20% (91 runs sampled)
Ajv x 10,259,113 ops/sec ±0.96% (83 runs sampled)
Fastest is Ajv

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@RomainLanz
Copy link
Member

Hey @lolo32,

Sorry for the delay.
Could you please resolve the conflict?

@RomainLanz
Copy link
Member

Closed in favor of #39

@RomainLanz RomainLanz closed this Feb 22, 2024
@nakrovati nakrovati mentioned this pull request Feb 22, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants