Home

Awesome

json-schema-benchmark (draft6)

Performance benchmark for Node.js JSON-schema validators.

Also tests against official JSON-schema test suite, version draft6. and checks for validators that cause side-effects on schema or data. The top 6 validators that fail the least tests are included in the benchmark.

Contribute to these benchmarks

Performance

performance

ValidatorRelative speedNumber of test runs per second
ajv100%17000 (± 0.34%)
@exodus/schemasafe69.2%11760 (± 0.89%)
is-my-json-valid51.5%8757 (± 0.37%)
djv13.1%2223 (± 1.24%)
@cfworker/json-schema5.1%865 (± 1.15%)
jsonschema1.2%198 (± 1.11%)

884 tests are run in each test run.

Validators tested: @exodus/schemasafe (1.0.0-rc.3), @cfworker/json-schema (1.6.3), ajv (6.12.6), jsonschema (1.4.0), djv (2.1.3-alpha.0), is-my-json-valid (2.20.5), json-schema-library (4.1.4), jsen (0.6.6), tv4 (1.3.0), z-schema (5.0.0), jjv (1.0.2), jassi (0.1.2), themis (1.1.6), request-validator (0.3.3), json-schema-validator-generator (1.1.11), json-model (0.2.24), jsck (0.3.2), JSV (4.0.2), skeemas (1.2.5), schemasaurus (0.7.8), json-gate (0.8.23), revalidator (0.3.1),

(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.

Test failure summary

This test suite uses the official JSON-schema test suite, version draft6.

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

failing tests

ValidatorNumber of failing tests (click for details)
@exodus/schemasafe8
@cfworker/json-schema9
ajv10
jsonschema33
djv99
is-my-json-valid111
json-schema-library140
jsen141
tv4155
z-schema169
jjv171
jassi172
themis189
request-validator207
json-schema-validator-generator216
json-model225
jsck227
JSV234
skeemas235
schemasaurus237
json-gate342
revalidator384

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.

ValidatorNumber of side-effects (BAD)
revalidator818
json-model833

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

Tests for other JSON-schema versions

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 z-schema

Benchmarks owned by themis

Benchmarks owned by jsck

There is also a benchmark suite by cosmicrealms.

License

MIT