Skip to content

Commit 398efa5

Browse files
committed
include top 4 validators based on least failing tests
1 parent be94f5a commit 398efa5

17 files changed

+764
-738
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ for validators that cause side-effects on schema or data.
88

99
# Performance
1010

11-
![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=129,4,1&chs=600x419&chxl=-1:|ajv|is-my-json-valid|@cfworker/json-schema&chd=t:100,44.3,3.8)
11+
![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=96,4,1&chs=600x420&chxl=-1:|ajv|is-my-json-valid|z-schema|@cfworker/json-schema&chd=t:100,53,6,4.7)
1212

1313
|Validator|Relative speed|Number of test runs per second|
1414
|---------|:------------:|:----------------------------:|
15-
|[`ajv`](https://github.com/epoberezkin/ajv)|100%|35960 (± 0.28%)|
16-
|[`is-my-json-valid`](https://github.com/mafintosh/is-my-json-valid)|44.3%|15947 (± 0.67%)|
17-
|[`@cfworker/json-schema`](https://github.com/cfworker/cfworker/tree/master/packages/json-schema/README.md)|3.8%|1362 (± 0.83%)|
15+
|[`ajv`](https://github.com/epoberezkin/ajv)|100%|28505 (± 6.02%)|
16+
|[`is-my-json-valid`](https://github.com/mafintosh/is-my-json-valid)|53%|15096 (± 2.29%)|
17+
|[`z-schema`](https://github.com/zaggino/z-schema)|6%|1703 (± 3.31%)|
18+
|[`@cfworker/json-schema`](https://github.com/cfworker/cfworker/tree/master/packages/json-schema/README.md)|4.7%|1353 (± 2.19%)|
1819

1920
235 tests are run in each test run.
2021

package-lock.json

Lines changed: 41 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"devDependencies": {},
4040
"scripts": {
4141
"test": "node --experimental-modules --es-module-specifier-resolution=node index.js",
42-
"update": "rm -rf node_modules/ && rm package-lock.json && npm i && npm audit fix && node ."
42+
"update": "rm -rf node_modules/* && rm package-lock.json && npm i && npm audit fix && node ."
4343
},
4444
"repository": {
4545
"type": "git",

reports/JSV.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,18 @@ that is the case for these tests.
9393
`ref overrides any sibling keywords, ref valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
9494
`ref overrides any sibling keywords, ref valid, maxItems ignored`|Expected result: `true` but validator returned: `false`
9595
`remote ref, containing refs itself, remote ref valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
96-
`Recursive references between schemas, valid tree`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
96+
`Recursive references between schemas, valid tree`|Expected result: `true` but validator returned: `false`
9797
`refs with quote, object with numbers is valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
9898
`Location-independent identifier, mismatch`|Expected result: `false` but validator returned: `true`
9999
`Location-independent identifier with absolute URI, mismatch`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**
100100
`Location-independent identifier with base URI change in subschema, mismatch`|Expected result: `false` but validator returned: `true`
101101
`remote ref, remote ref valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
102102
`fragment within remote ref, remote fragment valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
103-
`ref within remote ref, ref within ref valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
103+
`ref within remote ref, ref within ref valid`|Expected result: `true` but validator returned: `false`
104104
`base URI change, base URI change ref valid`|Expected result: `true` but validator returned: `false`
105105
`base URI change - change folder, number is valid`|Expected result: `true` but validator returned: `false`
106106
`base URI change - change folder in subschema, number is valid`|Expected result: `true` but validator returned: `false`
107-
`root ref in remote ref, string is valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
107+
`root ref in remote ref, string is valid`|Expected result: `true` but validator returned: `false`
108108
`root ref in remote ref, null is valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
109109
`required validation, present required property is valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
110110
`required validation, ignores arrays`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**

reports/djv.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ that is the case for these tests.
6767
`refs with quote, object with strings is invalid`|The schema failed to load(`missing ) after argument list`). **This excludes this validator from performance tests**
6868
`Location-independent identifier, match`|Expected result: `true` but validator returned: `"Maximum call stack size exceeded"`
6969
`Location-independent identifier, mismatch`|Expected result: `false` but validator returned: `"Maximum call stack size exceeded"`
70-
`Location-independent identifier with absolute URI, match`|Expected result: `true` but validator returned: `"Maximum call stack size exceeded"`. **This excludes this validator from performance tests**
70+
`Location-independent identifier with absolute URI, match`|Expected result: `true` but validator returned: `"Maximum call stack size exceeded"`
7171
`Location-independent identifier with absolute URI, mismatch`|Expected result: `false` but validator returned: `"Maximum call stack size exceeded"`. **This excludes this validator from performance tests**
7272
`Location-independent identifier with base URI change in subschema, match`|Expected result: `true` but validator returned: `"Maximum call stack size exceeded"`
7373
`Location-independent identifier with base URI change in subschema, mismatch`|Expected result: `false` but validator returned: `"Maximum call stack size exceeded"`

reports/jjv.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ that is the case for these tests.
7272
`escaped pointer ref, slash valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
7373
`escaped pointer ref, tilda valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
7474
`escaped pointer ref, percent valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
75-
`Recursive references between schemas, valid tree`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
75+
`Recursive references between schemas, valid tree`|Expected result: `true` but validator returned: `false`
7676
`refs with quote, object with numbers is valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
7777
`Location-independent identifier, match`|Expected result: `true` but validator returned: `false`
78-
`Location-independent identifier with absolute URI, match`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
78+
`Location-independent identifier with absolute URI, match`|Expected result: `true` but validator returned: `false`
7979
`Location-independent identifier with base URI change in subschema, match`|Expected result: `true` but validator returned: `false`
8080
`base URI change, base URI change ref valid`|Expected result: `true` but validator returned: `false`
8181
`base URI change - change folder, number is valid`|Expected result: `true` but validator returned: `false`
8282
`base URI change - change folder in subschema, number is valid`|Expected result: `true` but validator returned: `false`
83-
`root ref in remote ref, string is valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
83+
`root ref in remote ref, string is valid`|Expected result: `true` but validator returned: `false`
8484
`root ref in remote ref, null is valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
8585
`required validation, ignores strings`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
8686
`required validation, ignores other non-objects`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**

reports/jsck.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,27 @@ that is the case for these tests.
2929
`Proper UTF-16 surrogate pair handling: pattern, matches empty`|Expected result: `true` but validator returned: `false`
3030
`Proper UTF-16 surrogate pair handling: pattern, matches two`|Expected result: `true` but validator returned: `false`
3131
`ref overrides any sibling keywords, ref valid, maxItems ignored`|Expected result: `true` but validator returned: `false`
32-
`Recursive references between schemas, valid tree`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/node","http://localhost:1234/tree"]`). **This excludes this validator from performance tests**
32+
`Recursive references between schemas, valid tree`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/node","http://localhost:1234/tree"]`)
3333
`Recursive references between schemas, invalid tree`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/node","http://localhost:1234/tree"]`)
3434
`refs with quote, object with numbers is valid`|The schema failed to load(`Unresolvable $ref values: ["#/definitions/foo%22bar"]`). **This excludes this validator from performance tests**
3535
`refs with quote, object with strings is invalid`|The schema failed to load(`Unresolvable $ref values: ["#/definitions/foo%22bar"]`). **This excludes this validator from performance tests**
36-
`Location-independent identifier with absolute URI, match`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/bar#foo"]`). **This excludes this validator from performance tests**
36+
`Location-independent identifier with absolute URI, match`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/bar#foo"]`)
3737
`Location-independent identifier with absolute URI, mismatch`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/bar#foo"]`). **This excludes this validator from performance tests**
3838
`Location-independent identifier with base URI change in subschema, match`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/nested.json#foo"]`)
3939
`Location-independent identifier with base URI change in subschema, mismatch`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/nested.json#foo"]`)
4040
`remote ref, remote ref valid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/integer.json"]`). **This excludes this validator from performance tests**
4141
`remote ref, remote ref invalid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/integer.json"]`). **This excludes this validator from performance tests**
4242
`fragment within remote ref, remote fragment valid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/subSchemas.json#/integer"]`). **This excludes this validator from performance tests**
4343
`fragment within remote ref, remote fragment invalid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/subSchemas.json#/integer"]`). **This excludes this validator from performance tests**
44-
`ref within remote ref, ref within ref valid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/subSchemas.json#/refToInteger"]`). **This excludes this validator from performance tests**
44+
`ref within remote ref, ref within ref valid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/subSchemas.json#/refToInteger"]`)
4545
`ref within remote ref, ref within ref invalid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/subSchemas.json#/refToInteger"]`)
4646
`base URI change, base URI change ref valid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/"]`)
4747
`base URI change, base URI change ref invalid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/"]`)
4848
`base URI change - change folder, number is valid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/folderInteger.json"]`)
4949
`base URI change - change folder, string is invalid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/folderInteger.json"]`)
5050
`base URI change - change folder in subschema, number is valid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/folderInteger.json"]`)
5151
`base URI change - change folder in subschema, string is invalid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/folderInteger.json"]`)
52-
`root ref in remote ref, string is valid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/name.json#/definitions/orNull"]`). **This excludes this validator from performance tests**
52+
`root ref in remote ref, string is valid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/name.json#/definitions/orNull"]`)
5353
`root ref in remote ref, null is valid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/name.json#/definitions/orNull"]`). **This excludes this validator from performance tests**
5454
`root ref in remote ref, object is invalid`|The schema failed to load(`Unresolvable $ref values: ["http://localhost:1234/name.json#/definitions/orNull"]`)
5555
`uniqueItems validation, non-unique array of integers is invalid`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**

reports/jsen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ that is the case for these tests.
3636
`Proper UTF-16 surrogate pair handling: pattern, matches two`|Expected result: `true` but validator returned: `false`
3737
`properties with escaped characters, object with all numbers is valid`|The schema failed to load(`Invalid or unexpected token`). **This excludes this validator from performance tests**
3838
`properties with escaped characters, object with strings is invalid`|The schema failed to load(`Invalid or unexpected token`). **This excludes this validator from performance tests**
39-
`root ref in remote ref, string is valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
39+
`root ref in remote ref, string is valid`|Expected result: `true` but validator returned: `false`
4040
`root ref in remote ref, object is invalid`|Expected result: `false` but validator returned: `true`
4141
`required with escaped characters, object with all properties present is valid`|The schema failed to load(`Invalid or unexpected token`). **This excludes this validator from performance tests**
4242
`required with escaped characters, object with some properties missing is invalid`|The schema failed to load(`Invalid or unexpected token`). **This excludes this validator from performance tests**

0 commit comments

Comments
 (0)