npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

json-schema-benchmark

v1.0.2

Published

Benchmarks for Node.js JSON-schema validators

Downloads

64

Readme

json-schema-benchmark

Performance benchmark for Node.js JSON-schema validators.

Also tests against official JSON-schema test suite and checks for validators that cause side-effects on schema or data.

Contribute to these benchmarks

Performance

performance

|Validator|Relative speed|Number of test runs per second| |---------|:------------:|:----------------------------:| |ajv|100%|20121 (± 0.57%)| |jsen|63.4%|12754 (± 0.75%)| |is-my-json-valid|59.7%|12011 (± 0.67%)| |schemasaurus|17.3%|3485 (± 2.51%)| |themis|12.2%|2446 (± 1.64%)| |z-schema|6.3%|1275 (± 1.55%)| |jjv|3.8%|763 (± 2.7%)| |jsck|2.6%|528 (± 3.75%)| |jsonschema|0.6%|128 (± 2.8%)| |skeemas|0.6%|125 (± 3.43%)| |request-validator|0.4%|78 (± 3.25%)| |tv4|0.2%|32 (± 4.48%)| |jayschema|0.1%|13 (± 6.01%)|

Validators tested: is-my-json-valid, jsen, ajv, themis, z-schema, jjv, skeemas, jayschema, schemasaurus, jsck, jassi, JSV, request-validator, json-gate, json-model, tv4, jsonschema, revalidator,

(validators not in the results above where excluded because of failing tests - see below for details)

ajv is currently the fastest JSON-schema validator out there.

The fastest validator has 100%, the rest a lower score relative to the fastest. If a validator has a score of 5% that means that it's speed is 5% of the fastest, meaning that it's 20 times slower than the fastest.

Test failure summary

This test suite uses the official JSON-schema test suite.

If a validator does not pass a test in the official test suite, it will show up in these results.

failing tests

|Validator|Number of failing tests (click for details)| |---------|-----------------------| |ajv|1| |skeemas|1| |z-schema|3| |jsonschema|3| |jjv|4| |is-my-json-valid|9| |jayschema|10| |jsen|11| |themis|13| |schemasaurus|15| |jsck|21| |tv4|24| |request-validator|26| |jassi|31| |json-model|40| |JSV|54| |json-gate|70| |revalidator|199|

Some validators have deliberately chosen not to support parts of the spec. Go to the homepage of the validator to learn if that is the case for these tests.

Side-effects summary

Number of tests that caused side-effects. The schema or data was altered by the validator.

|Validator|Number of side-effects (BAD)| |---------|----------------------------| |tv4|2| |revalidator|147| |json-model|283|

Validators not in the list have no side-effects on data or schemas.

Features of validators

Note that these benchmarks and tests do not take into account other more advanced features of the validators. I encourage you to take a look at each validator if you are looking for special features.

Benchmarks by validator authors and others

Several of the validators have build benchmarks themselves. They are more detailed then the benchmarks provided above.

Benchmarks owned by themis

Benchmarks owned by z-schema

Benchmarks owned by jsck

There is also a benchmark suite by cosmicrealms.

License

MIT