Skip to content

atrniv/json-schema-benchmark

 
 

Repository files navigation

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.

Performance

performance

Validator Relative speed Number of test runs per second
is-my-json-valid 100% 15539 (± 1.79%)
themis 27.6% 4287 (± 2.44%)
jsck 11.6% 1805 (± 0.76%)
z-schema 9.1% 1411 (± 3.59%)
jjv 7.6% 1183 (± 0.92%)
skeemas 1.4% 218 (± 0.58%)
request-validator 0.7% 110 (± 4.2%)
jsonschema 0.6% 90 (± 3.88%)
tv4 0.3% 39 (± 2.9%)
jayschema 0.1% 13 (± 4.05%)

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

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

is-my-json-valid 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)
skeemas 1
jjv 4
jsonschema 5
z-schema 5
is-my-json-valid 9
jayschema 10
themis 13
jsck 21
request-validator 26
tv4 26
jassi 31
json-model 40
JSV 54

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
jsonschema 4
json-model 283
z-schema 290

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.

License

MIT

About

Benchmarks for Node.js JSON-schema validators

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%