Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/muscula/json-schema-benchmark
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
Validator | Relative speed | Number of test runs per second |
---|---|---|
ajv | 100% | 17000 (± 0.34%) |
@exodus/schemasafe | 69.2% | 11760 (± 0.89%) |
is-my-json-valid | 51.5% | 8757 (± 0.37%) |
djv | 13.1% | 2223 (± 1.24%) |
@cfworker/json-schema | 5.1% | 865 (± 1.15%) |
jsonschema | 1.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.
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.
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.
Number of tests that caused side-effects. The schema or data was altered by the validator.
Validator | Number of side-effects (BAD) |
---|---|
revalidator | 818 |
json-model | 833 |
Validators not in the list have no side-effects on data or schemas.
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.
Several of the validators have build benchmarks themselves. They are more detailed then the benchmarks provided above.
There is also a benchmark suite by cosmicrealms.
MIT
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.