DEV Community

loading...

Benchmarking correctness and performance of Go JSON schema validators

vearutop profile image Viacheslav Poturaev ・35 min read

JSON schema is a popular technology to describe structured data in a programming language agnostic way.

One of the most useful applications of JSON schema is data validation.

Constraints provided by schema are stateless and allow predictable and high performance check of data conformance.

For example, given this schema:

{
    "type": "object",
    "properties": {
        "foo": {
            "type": "string",
            "minLength": 5
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

This value would be valid:

{"foo":"abcdef"}
Enter fullscreen mode Exit fullscreen mode

And this would be not:

{"foo":"abc"}
Enter fullscreen mode Exit fullscreen mode

As implementations list suggests, these libraries can validate JSON schema in Go:

Let's see how good are they.

Great thing about JSON schema is that a test suite is available to check the correctness of implementation. Some test cases are optional, it means they may fail and user should not rely on their behavior unless implementation specifically declares such support. Test cases in format.json are also considered as best effort implementation and may fail.

Another source of test cases is ajv-validator - one of the best implementations available across all languages.

Correctness

This repo includes test case sources as git submodules and implements test case adapters for validators.

Test report

santhosh-tekuri/jsonschema failed tests count
draft 7          | 1
draft 7 format   | 90
draft 7 optional | 48
ajv              | 0
qri-io/jsonschema failed tests count
draft 7          | 51
draft 7 format   | 0
draft 7 optional | 37
ajv              | 6
xeipuuv/gojsonschema failed tests count
draft 7          | 0
draft 7 format   | 32
draft 7 optional | 49
ajv              | 0
Enter fullscreen mode Exit fullscreen mode

We can see that both santhosh-tekuri/jsonschema and xeipuuv/gojsonschema are good in general schema compliance.

The failing edge case for santhosh-tekuri/jsonschema was recently added to JSON Schema Test Suite:

            {
                "description": "a float with zero fractional part is an integer",
                "data": 1.0,
                "valid": true
            }
Enter fullscreen mode Exit fullscreen mode

Unfortunately qri-io/jsonschema fails quite a few tests in general suite and also in ajv suite. The correctness of this library is questionable. Though this library has remarkable results in validating format.

Performance

Tests that were used for correctness can also be used to benchmark performance.

Schema is initialized before benchmark, so that every iteration performs only validation. Benchmark result is aggregated with benchstat.

Performance Benchmark Reports.

AJV Suite Time/Op

Let's start with ajv suite, it contains complex schemas that especially fit for performance benchmarks.

name \ time/op    santhosh-ajv.txt  qri-ajv.txt   xeipuuv-ajv.txt
[Geo mean]        15.3µs            10.4µs        27.5µs     
Enter fullscreen mode Exit fullscreen mode

This result shows how much time does it take to validate a value. Geo mean is aggregated from results of all test cases.

The mean result for qri-io/jsonschema is not representative because validation failed for several slow tests and did not reduce the mean result. Please check full report below to compare performance of qri-io/jsonschema with its rivals.

Results for santhosh-ajv.txt and xeipuuv-ajv.txt are comparable since both have successfully passed a full benchmark.

santhosh-tekuri/jsonschema is almost two times faster than xeipuuv/gojsonschema for complex schemas.

full benchstat report
name \ time/op                                                                                                                          santhosh-ajv.txt  qri-ajv.txt   xeipuuv-ajv.txt
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):valid_object_from_z-schema_benchmark-2        111µs ± 7%                     219µs ± 1%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):not_object-2                                 1.95µs ± 5%   2.69µs ± 4%      4.70µs ± 2%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):root_only_is_valid-2                         24.7µs ± 2%                    51.4µs ± 4%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):missing_root_entry-2                         9.48µs ± 4%   9.00µs ± 2%     19.09µs ± 4%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):invalid_entry_key-2                          33.2µs ± 5%   18.3µs ± 1%      68.0µs ± 2%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):missing_storage_in_entry-2                   7.07µs ± 2%  10.10µs ± 1%     17.25µs ± 3%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):missing_storage_type-2                       31.0µs ± 2%   12.0µs ± 3%      47.2µs ± 3%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):storage_type_should_be_a_string-2            35.5µs ± 2%   12.7µs ± 4%      57.5µs ± 3%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):storage_device_should_match_pattern-2        38.1µs ± 4%   12.7µs ± 2%      65.4µs ± 6%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):valid_array_from_z-schema_benchmark-2              32.5µs ± 3%   48.5µs ± 9%      48.8µs ± 6%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):not_array-2                                        1.87µs ± 7%   2.65µs ± 1%      4.92µs ± 7%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):array_of_not_onjects-2                             4.71µs ± 4%   7.00µs ± 5%     13.33µs ± 4%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):missing_required_properties-2                      3.26µs ± 2%   5.76µs ± 5%      8.11µs ± 3%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):required_property_of_wrong_type-2                  5.18µs ± 1%   9.44µs ± 5%      9.00µs ± 3%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):smallest_valid_product-2                           4.26µs ± 1%   8.15µs ± 5%      6.87µs ± 5%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):tags_should_be_array-2                             6.19µs ± 2%  10.75µs ± 6%     11.24µs ± 5%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):dimensions_should_be_object-2                      6.33µs ± 2%  10.91µs ± 7%     11.25µs ± 5%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):valid_product_with_tag-2                           5.69µs ±13%  10.66µs ± 3%     10.15µs ± 3%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):dimensions_miss_required_properties-2              8.79µs ± 4%  14.68µs ± 2%     18.81µs ± 2%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):valid_product_with_tag_and_dimensions-2            9.67µs ± 5%  16.72µs ± 2%     17.01µs ± 3%
Ajv/complex.json:complex_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):valid_array_from_jsck_benchmark-2                   328µs ±15%                     340µs ± 1%
Ajv/complex.json:complex_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):not_array-2                                        2.15µs ± 6%   2.56µs ± 4%      4.80µs ± 6%
Ajv/complex2.json:complex_schema_from_jsck_benchmark_without_IDs_in_definitions:valid_array_from_jsck_benchmark-2                             306µs ± 7%                     350µs ± 3%
Ajv/complex2.json:complex_schema_from_jsck_benchmark_without_IDs_in_definitions:not_array-2                                                  2.23µs ± 4%   2.57µs ± 5%      4.84µs ± 4%
Ajv/complex2.json:complex_schema_from_jsck_benchmark_without_IDs_in_definitions:one_valid_item-2                                             93.8µs ± 7%                   104.4µs ± 4%
Ajv/complex2.json:complex_schema_from_jsck_benchmark_without_IDs_in_definitions:one_invalid_item-2                                            100µs ± 5%     36µs ± 1%       120µs ± 7%
Ajv/complex3.json:complex_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):valid_array_from_jsck_benchmark-2                  307µs ± 4%                     343µs ± 2%
Ajv/complex3.json:complex_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):not_array-2                                       2.07µs ±10%   2.78µs ± 3%      4.70µs ± 2%
Ajv/cosmicrealms.json:schema_from_cosmicrealms_benchmark:valid_data_from_cosmicrealms_benchmark-2                                            50.2µs ± 2%   61.9µs ± 2%      84.2µs ± 6%
Ajv/cosmicrealms.json:schema_from_cosmicrealms_benchmark:invalid_data-2                                                                      79.5µs ± 6%   68.5µs ± 2%     151.6µs ± 4%
Ajv/medium.json:medium_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):valid_object_from_jsck_benchmark-2                   19.5µs ± 3%   38.0µs ± 1%      22.6µs ± 4%
Ajv/medium.json:medium_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):not_object-2                                         1.98µs ± 6%   2.66µs ± 3%      5.37µs ± 7%
[Geo mean]                                                                                                                                   15.3µs        10.4µs           27.5µs     
Enter fullscreen mode Exit fullscreen mode

Draft 7 Time/Op

name \ time/op   santhosh-draft7.txt  qri-draft7.txt  xeipuuv-draft7.txt
[Geo mean]       2.66µs               4.03µs          4.92µs     
Enter fullscreen mode Exit fullscreen mode

Test cases in draft 7 suite are smaller and less complex, so overall performance results are better. Here santhosh-tekuri/jsonschema is also almost two times faster than xeipuuv/gojsonschema.

full benchstat report
name \ time/op                                                                                                                                       santhosh-draft7.txt  qri-draft7.txt  xeipuuv-draft7.txt
Draft7/additionalItems.json:additionalItems_as_schema:additional_items_match_schema-2                                                                        5.23µs ± 5%     6.11µs ± 2%         6.13µs ± 2%
Draft7/additionalItems.json:additionalItems_as_schema:additional_items_do_not_match_schema-2                                                                 5.07µs ± 4%     6.55µs ± 3%         8.28µs ± 1%
Draft7/additionalItems.json:items_is_schema,_no_additionalItems:all_items_match_schema-2                                                                     5.20µs ± 3%     5.39µs ± 3%         9.27µs ± 4%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:empty_array-2                                                                             1.04µs ± 7%     2.31µs ± 2%         1.27µs ± 2%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:fewer_number_of_items_present_(1)-2                                                       1.93µs ± 3%     3.08µs ± 2%         2.82µs ± 2%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:fewer_number_of_items_present_(2)-2                                                       2.83µs ± 6%     3.78µs ± 5%         4.37µs ± 1%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:equal_number_of_items_present-2                                                           3.62µs ± 7%     4.31µs ± 2%         5.84µs ± 1%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:additional_items_are_not_permitted-2                                                      4.23µs ± 1%     4.94µs ± 3%         7.42µs ± 2%
Draft7/additionalItems.json:additionalItems_as_false_without_items:items_defaults_to_empty_schema_so_everything_is_valid-2                                   2.11µs ± 4%     3.41µs ± 4%         2.35µs ± 3%
Draft7/additionalItems.json:additionalItems_as_false_without_items:ignores_non-arrays-2                                                                      1.51µs ± 2%     2.60µs ± 6%         1.73µs ± 1%
Draft7/additionalItems.json:additionalItems_are_allowed_by_default:only_the_first_item_is_validated-2                                                        2.91µs ± 1%     3.74µs ± 7%         3.37µs ± 2%
Draft7/additionalItems.json:additionalItems_should_not_look_in_applicators,_valid_case:items_defined_in_allOf_are_not_examined-2                             2.68µs ± 2%                         3.43µs ± 9%
Draft7/additionalItems.json:additionalItems_should_not_look_in_applicators,_invalid_case:items_defined_in_allOf_are_not_examined-2                           4.69µs ± 3%                         8.66µs ± 3%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:no_additional_properties_is_valid-2                        2.74µs ± 2%     4.92µs ± 6%         5.21µs ± 4%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:an_additional_property_is_invalid-2                        5.47µs ± 2%     7.31µs ± 4%        13.50µs ± 1%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:ignores_arrays-2                                           1.65µs ± 4%     3.08µs ± 4%         1.91µs ± 2%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:ignores_strings-2                                          1.53µs ± 5%     2.20µs ± 5%         1.85µs ± 4%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:ignores_other_non-objects-2                                2.04µs ± 3%     2.23µs ± 3%         2.84µs ± 4%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:patternProperties_are_not_additional_properties-2          4.04µs ± 2%     6.47µs ± 7%         9.17µs ± 3%
Draft7/additionalProperties.json:non-ASCII_pattern_with_additionalProperties:matching_the_pattern_is_valid-2                                                 2.84µs ± 2%     4.74µs ± 8%         5.49µs ± 4%
Draft7/additionalProperties.json:non-ASCII_pattern_with_additionalProperties:not_matching_the_pattern_is_invalid-2                                           2.96µs ± 3%     3.68µs ± 3%         5.89µs ± 2%
Draft7/additionalProperties.json:additionalProperties_allows_a_schema_which_should_validate:no_additional_properties_is_valid-2                              2.52µs ± 5%     4.40µs ± 2%         3.05µs ± 3%
Draft7/additionalProperties.json:additionalProperties_allows_a_schema_which_should_validate:an_additional_valid_property_is_valid-2                          4.05µs ± 7%     6.22µs ± 3%         5.11µs ± 1%
Draft7/additionalProperties.json:additionalProperties_allows_a_schema_which_should_validate:an_additional_invalid_property_is_invalid-2                      5.08µs ± 4%     7.25µs ± 2%         8.80µs ± 2%
Draft7/additionalProperties.json:additionalProperties_can_exist_by_itself:an_additional_valid_property_is_valid-2                                            1.70µs ± 4%     3.80µs ± 5%         1.90µs ± 3%
Draft7/additionalProperties.json:additionalProperties_can_exist_by_itself:an_additional_invalid_property_is_invalid-2                                        2.58µs ± 2%     4.70µs ± 2%         5.32µs ± 1%
Draft7/additionalProperties.json:additionalProperties_are_allowed_by_default:additional_properties_are_allowed-2                                             3.46µs ± 1%     5.19µs ± 4%         5.06µs ± 4%
Draft7/additionalProperties.json:additionalProperties_should_not_look_in_applicators:properties_defined_in_allOf_are_not_examined-2                          4.04µs ± 5%                         7.53µs ± 1%
Draft7/allOf.json:allOf:allOf-2                                                                                                                              3.54µs ± 0%     8.61µs ± 2%         4.41µs ± 3%
Draft7/allOf.json:allOf:mismatch_second-2                                                                                                                    3.38µs ± 5%     6.89µs ± 2%         5.98µs ± 3%
Draft7/allOf.json:allOf:mismatch_first-2                                                                                                                     4.47µs ± 3%     7.08µs ± 3%         7.17µs ± 1%
Draft7/allOf.json:allOf:wrong_type-2                                                                                                                         4.01µs ± 1%     9.01µs ± 3%         7.29µs ± 1%
Draft7/allOf.json:allOf_with_base_schema:valid-2                                                                                                             3.84µs ± 2%    10.05µs ± 4%         5.04µs ± 1%
Draft7/allOf.json:allOf_with_base_schema:mismatch_base_schema-2                                                                                              3.18µs ± 4%     9.02µs ± 2%         5.11µs ± 3%
Draft7/allOf.json:allOf_with_base_schema:mismatch_first_allOf-2                                                                                              5.18µs ± 5%     8.48µs ± 1%         7.85µs ± 3%
Draft7/allOf.json:allOf_with_base_schema:mismatch_second_allOf-2                                                                                             5.38µs ± 2%     8.74µs ± 2%         8.14µs ± 2%
Draft7/allOf.json:allOf_with_base_schema:mismatch_both-2                                                                                                     6.60µs ± 3%     7.35µs ± 2%         9.37µs ± 4%
Draft7/allOf.json:allOf_simple_types:valid-2                                                                                                                 3.33µs ± 4%     3.87µs ± 3%         5.62µs ± 2%
Draft7/allOf.json:allOf_simple_types:mismatch_one-2                                                                                                          7.34µs ± 2%     4.96µs ± 5%        15.68µs ± 3%
Draft7/allOf.json:allOf_with_boolean_schemas,_all_true:any_value_is_valid-2                                                                                  1.46µs ± 7%     3.58µs ± 4%         1.95µs ± 4%
Draft7/allOf.json:allOf_with_boolean_schemas,_some_false:any_value_is_invalid-2                                                                              2.24µs ± 2%     4.11µs ± 2%         4.39µs ± 2%
Draft7/allOf.json:allOf_with_boolean_schemas,_all_false:any_value_is_invalid-2                                                                               3.58µs ± 6%     4.69µs ± 7%         5.78µs ± 4%
Draft7/allOf.json:allOf_with_one_empty_schema:any_data_is_valid-2                                                                                            2.56µs ± 3%     2.97µs ± 2%         3.86µs ± 3%
Draft7/allOf.json:allOf_with_two_empty_schemas:any_data_is_valid-2                                                                                           3.06µs ± 2%     3.67µs ± 3%         5.09µs ± 3%
Draft7/allOf.json:allOf_with_the_first_empty_schema:number_is_valid-2                                                                                        3.18µs ± 1%     3.79µs ± 5%         5.23µs ± 4%
Draft7/allOf.json:allOf_with_the_first_empty_schema:string_is_invalid-2                                                                                      2.68µs ± 4%     4.46µs ± 3%         6.48µs ± 2%
Draft7/allOf.json:allOf_with_the_last_empty_schema:number_is_valid-2                                                                                         3.13µs ± 2%     3.79µs ± 2%         5.18µs ± 5%
Draft7/allOf.json:allOf_with_the_last_empty_schema:string_is_invalid-2                                                                                       2.66µs ± 4%     4.55µs ± 3%         6.26µs ± 3%
Draft7/allOf.json:nested_allOf,_to_check_validation_semantics:null_is_valid-2                                                                                1.40µs ± 5%     3.87µs ± 2%         1.65µs ± 1%
Draft7/allOf.json:nested_allOf,_to_check_validation_semantics:anything_non-null_is_invalid-2                                                                 4.54µs ± 1%     4.93µs ± 1%        10.24µs ± 2%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_false,_anyOf:_false,_oneOf:_false-2                                                                18.8µs ± 1%      7.6µs ± 2%         38.1µs ± 2%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_false,_anyOf:_false,_oneOf:_true-2                                                                 14.7µs ± 5%      6.6µs ± 3%         27.7µs ± 2%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_false,_anyOf:_true,_oneOf:_false-2                                                                 14.1µs ± 6%      6.6µs ± 2%         27.1µs ± 2%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_false,_anyOf:_true,_oneOf:_true-2                                                                  9.77µs ± 0%     5.79µs ± 3%        18.16µs ± 3%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_true,_anyOf:_false,_oneOf:_false-2                                                                 14.9µs ± 3%      6.9µs ± 5%         27.5µs ± 2%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_true,_anyOf:_false,_oneOf:_true-2                                                                  9.79µs ± 4%     5.85µs ± 2%        18.53µs ± 3%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_true,_anyOf:_true,_oneOf:_false-2                                                                  9.48µs ± 1%     5.87µs ± 3%        17.98µs ± 3%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_true,_anyOf:_true,_oneOf:_true-2                                                                   5.03µs ± 2%     4.70µs ± 3%         8.06µs ± 3%
Draft7/anyOf.json:anyOf:first_anyOf_valid-2                                                                                                                  3.27µs ± 4%     2.67µs ± 3%         3.98µs ± 5%
Draft7/anyOf.json:anyOf:second_anyOf_valid-2                                                                                                                 4.75µs ± 1%     4.12µs ± 7%         9.36µs ± 3%
Draft7/anyOf.json:anyOf:both_anyOf_valid-2                                                                                                                   3.18µs ± 3%     2.78µs ± 9%         3.93µs ± 3%
Draft7/anyOf.json:anyOf:neither_anyOf_valid-2                                                                                                                9.69µs ± 3%     5.13µs ± 1%        20.25µs ± 5%
Draft7/anyOf.json:anyOf_with_base_schema:mismatch_base_schema-2                                                                                              1.92µs ± 5%     3.42µs ± 4%         4.66µs ± 3%
Draft7/anyOf.json:anyOf_with_base_schema:one_anyOf_valid-2                                                                                                   2.27µs ± 2%     4.27µs ± 3%         4.79µs ± 4%
Draft7/anyOf.json:anyOf_with_base_schema:both_anyOf_invalid-2                                                                                                3.68µs ± 2%     5.16µs ± 6%         8.10µs ± 2%
Draft7/anyOf.json:anyOf_with_boolean_schemas,_all_true:any_value_is_valid-2                                                                                  1.41µs ± 3%     2.69µs ± 7%         1.90µs ± 3%
Draft7/anyOf.json:anyOf_with_boolean_schemas,_some_true:any_value_is_valid-2                                                                                 1.40µs ± 3%     2.68µs ± 4%         1.94µs ± 3%
Draft7/anyOf.json:anyOf_with_boolean_schemas,_all_false:any_value_is_invalid-2                                                                               2.94µs ± 2%     4.09µs ± 4%         6.00µs ± 2%
Draft7/anyOf.json:anyOf_complex_types:first_anyOf_valid_(complex)-2                                                                                          2.90µs ± 3%     4.99µs ± 3%         3.33µs ± 4%
Draft7/anyOf.json:anyOf_complex_types:second_anyOf_valid_(complex)-2                                                                                         2.83µs ± 3%     6.51µs ± 2%         4.71µs ± 3%
Draft7/anyOf.json:anyOf_complex_types:both_anyOf_valid_(complex)-2                                                                                           3.29µs ± 3%     5.32µs ± 1%         3.85µs ± 4%
Draft7/anyOf.json:anyOf_complex_types:neither_anyOf_valid_(complex)-2                                                                                        5.41µs ± 3%     8.76µs ± 1%        10.85µs ± 2%
Draft7/anyOf.json:anyOf_with_one_empty_schema:string_is_valid-2                                                                                              2.12µs ± 5%     3.97µs ± 5%         5.05µs ± 2%
Draft7/anyOf.json:anyOf_with_one_empty_schema:number_is_valid-2                                                                                              2.80µs ± 4%     2.77µs ± 2%         4.13µs ± 3%
Draft7/anyOf.json:nested_anyOf,_to_check_validation_semantics:null_is_valid-2                                                                                1.47µs ± 3%     3.31µs ± 3%         1.66µs ± 3%
Draft7/anyOf.json:nested_anyOf,_to_check_validation_semantics:anything_non-null_is_invalid-2                                                                 4.97µs ± 2%     4.27µs ± 2%        10.67µs ± 4%
Draft7/anyOf.json:nested_anyOf,_to_check_validation_semantics:null_is_valid#01-2                                                                             1.42µs ± 2%     3.34µs ± 3%         1.68µs ± 6%
Draft7/anyOf.json:nested_anyOf,_to_check_validation_semantics:anything_non-null_is_invalid#01-2                                                              5.14µs ± 5%     4.31µs ± 2%        10.78µs ± 2%
Draft7/boolean_schema.json:boolean_schema_'true':number_is_valid-2                                                                                           1.38µs ± 4%     1.89µs ± 2%         1.49µs ± 6%
Draft7/boolean_schema.json:boolean_schema_'true':string_is_valid-2                                                                                           1.41µs ± 2%     1.86µs ± 4%         1.59µs ± 4%
Draft7/boolean_schema.json:boolean_schema_'true':boolean_true_is_valid-2                                                                                     1.31µs ± 4%     1.79µs ± 1%         1.46µs ± 2%
Draft7/boolean_schema.json:boolean_schema_'true':boolean_false_is_valid-2                                                                                    1.35µs ±11%     1.81µs ± 6%         1.46µs ± 1%
Draft7/boolean_schema.json:boolean_schema_'true':null_is_valid-2                                                                                             1.28µs ± 8%     1.85µs ± 4%         1.47µs ± 5%
Draft7/boolean_schema.json:boolean_schema_'true':object_is_valid-2                                                                                           1.45µs ± 3%     2.45µs ± 6%         1.59µs ± 4%
Draft7/boolean_schema.json:boolean_schema_'true':empty_object_is_valid-2                                                                                      930ns ± 2%     2014ns ± 6%         1100ns ± 6%
Draft7/boolean_schema.json:boolean_schema_'true':array_is_valid-2                                                                                            1.21µs ± 4%     2.32µs ± 4%         1.36µs ± 2%
Draft7/boolean_schema.json:boolean_schema_'true':empty_array_is_valid-2                                                                                       951ns ± 3%     1951ns ± 4%         1063ns ± 2%
Draft7/boolean_schema.json:boolean_schema_'false':number_is_invalid-2                                                                                        1.55µs ± 1%     2.32µs ± 6%         2.69µs ± 4%
Draft7/boolean_schema.json:boolean_schema_'false':string_is_invalid-2                                                                                        1.63µs ± 3%     2.34µs ± 4%         2.72µs ± 3%
Draft7/boolean_schema.json:boolean_schema_'false':boolean_true_is_invalid-2                                                                                  1.52µs ± 4%     2.29µs ± 5%         2.56µs ± 3%
Draft7/boolean_schema.json:boolean_schema_'false':boolean_false_is_invalid-2                                                                                 1.57µs ± 5%     2.27µs ± 6%         2.55µs ± 3%
Draft7/boolean_schema.json:boolean_schema_'false':null_is_invalid-2                                                                                          1.56µs ± 5%     2.16µs ± 4%         2.61µs ± 2%
Draft7/boolean_schema.json:boolean_schema_'false':object_is_invalid-2                                                                                        1.75µs ± 9%     2.86µs ± 2%         2.69µs ± 1%
Draft7/boolean_schema.json:boolean_schema_'false':empty_object_is_invalid-2                                                                                  1.16µs ± 4%     2.30µs ± 5%         2.19µs ± 3%
Draft7/boolean_schema.json:boolean_schema_'false':array_is_invalid-2                                                                                         1.44µs ± 5%     2.52µs ± 4%         2.34µs ± 4%
Draft7/boolean_schema.json:boolean_schema_'false':empty_array_is_invalid-2                                                                                   1.23µs ± 5%     2.23µs ± 3%         2.19µs ± 5%
Draft7/const.json:const_validation:same_value_is_valid-2                                                                                                     2.66µs ± 6%     2.58µs ± 4%         4.17µs ± 3%
Draft7/const.json:const_validation:another_value_is_invalid-2                                                                                                3.43µs ± 4%     3.48µs ± 2%         7.24µs ± 1%
Draft7/const.json:const_validation:another_type_is_invalid-2                                                                                                 2.13µs ±10%     3.42µs ± 8%         5.79µs ± 5%
Draft7/const.json:const_with_object:same_object_is_valid-2                                                                                                   2.21µs ± 4%     5.95µs ± 3%         7.82µs ± 4%
Draft7/const.json:const_with_object:same_object_with_different_property_order_is_valid-2                                                                     2.14µs ± 5%     5.81µs ± 3%         7.71µs ± 2%
Draft7/const.json:const_with_object:another_object_is_invalid-2                                                                                              1.99µs ± 3%     6.79µs ± 1%         8.08µs ± 1%
Draft7/const.json:const_with_object:another_type_is_invalid-2                                                                                                1.90µs ± 7%     6.46µs ± 2%         7.45µs ± 6%
Draft7/const.json:const_with_array:same_array_is_valid-2                                                                                                     2.05µs ± 6%     5.55µs ± 4%         6.67µs ± 5%
Draft7/const.json:const_with_array:another_array_item_is_invalid-2                                                                                           1.64µs ± 3%     6.04µs ± 5%         6.80µs ± 4%
Draft7/const.json:const_with_array:array_with_additional_items_is_invalid-2                                                                                  2.17µs ± 1%     6.38µs ± 2%         8.34µs ± 3%
Draft7/const.json:const_with_null:null_is_valid-2                                                                                                            1.37µs ± 3%     2.31µs ± 4%         2.53µs ± 3%
Draft7/const.json:const_with_null:not_null_is_invalid-2                                                                                                      2.39µs ± 2%     3.07µs ± 2%         6.74µs ± 2%
Draft7/const.json:const_with_false_does_not_match_0:false_is_valid-2                                                                                         1.39µs ± 3%     2.39µs ± 5%         2.78µs ± 5%
Draft7/const.json:const_with_false_does_not_match_0:integer_zero_is_invalid-2                                                                                2.43µs ± 5%     3.25µs ± 6%         6.70µs ± 1%
Draft7/const.json:const_with_false_does_not_match_0:float_zero_is_invalid-2                                                                                  2.49µs ± 1%     3.29µs ± 4%         6.75µs ± 4%
Draft7/const.json:const_with_true_does_not_match_1:true_is_valid-2                                                                                           1.36µs ± 2%     2.43µs ± 3%         2.72µs ± 1%
Draft7/const.json:const_with_true_does_not_match_1:integer_one_is_invalid-2                                                                                  2.57µs ± 2%     3.34µs ± 2%         7.33µs ± 2%
Draft7/const.json:const_with_true_does_not_match_1:float_one_is_invalid-2                                                                                    2.91µs ± 3%     3.43µs ± 3%         8.16µs ± 4%
Draft7/const.json:const_with_[false]_does_not_match_[0]:[false]_is_valid-2                                                                                   1.20µs ± 3%     3.38µs ± 4%         3.24µs ± 2%
Draft7/const.json:const_with_[false]_does_not_match_[0]:[0]_is_invalid-2                                                                                     1.62µs ± 3%     4.49µs ± 3%         6.43µs ± 3%
Draft7/const.json:const_with_[false]_does_not_match_[0]:[0.0]_is_invalid-2                                                                                   1.63µs ± 3%     4.48µs ± 2%         6.57µs ± 2%
Draft7/const.json:const_with_[true]_does_not_match_[1]:[true]_is_valid-2                                                                                     1.21µs ± 4%     3.33µs ± 3%         3.20µs ± 3%
Draft7/const.json:const_with_[true]_does_not_match_[1]:[1]_is_invalid-2                                                                                      1.70µs ± 8%     4.40µs ± 3%         6.35µs ± 1%
Draft7/const.json:const_with_[true]_does_not_match_[1]:[1.0]_is_invalid-2                                                                                    1.72µs ± 5%     4.53µs ± 1%         6.67µs ± 4%
Draft7/const.json:const_with_{"a":_false}_does_not_match_{"a":_0}:{"a":_false}_is_valid-2                                                                    1.61µs ± 4%     4.37µs ± 3%         5.03µs ± 3%
Draft7/const.json:const_with_{"a":_false}_does_not_match_{"a":_0}:{"a":_0}_is_invalid-2                                                                      2.13µs ± 8%     6.13µs ± 4%         8.09µs ± 7%
Draft7/const.json:const_with_{"a":_false}_does_not_match_{"a":_0}:{"a":_0.0}_is_invalid-2                                                                    2.04µs ± 2%     6.30µs ± 3%         8.30µs ± 1%
Draft7/const.json:const_with_{"a":_true}_does_not_match_{"a":_1}:{"a":_true}_is_valid-2                                                                      1.52µs ± 4%     4.23µs ± 2%         5.35µs ± 4%
Draft7/const.json:const_with_{"a":_true}_does_not_match_{"a":_1}:{"a":_1}_is_invalid-2                                                                       1.94µs ± 2%     6.16µs ± 2%         8.32µs ± 6%
Draft7/const.json:const_with_{"a":_true}_does_not_match_{"a":_1}:{"a":_1.0}_is_invalid-2                                                                                     6.27µs ± 6%         8.60µs ± 4%
Draft7/const.json:const_with_0_does_not_match_other_zero-like_types:false_is_invalid-2                                                                                       3.28µs ± 4%
Draft7/const.json:const_with_0_does_not_match_other_zero-like_types:integer_zero_is_valid-2                                                                                  2.51µs ± 3%
Draft7/const.json:const_with_0_does_not_match_other_zero-like_types:float_zero_is_valid-2                                                                                    2.57µs ± 2%
Draft7/const.json:const_with_0_does_not_match_other_zero-like_types:empty_object_is_invalid-2                                                                                3.54µs ± 0%
[Geo mean]                                                                                                                                                   2.66µs          4.03µs              4.92µs     
Enter fullscreen mode Exit fullscreen mode

AJV Suite Alloc/Op

name \ alloc/op   santhosh-ajv.txt  qri-ajv.txt   xeipuuv-ajv.txt
[Geo mean]        5.00kB            5.16kB        9.15kB     
Enter fullscreen mode Exit fullscreen mode

full benchstat report
name \ alloc/op                                                                                                                         santhosh-ajv.txt  qri-ajv.txt   xeipuuv-ajv.txt
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):valid_object_from_z-schema_benchmark-2       21.6kB ± 0%                    66.6kB ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):not_object-2                                 2.65kB ± 0%   2.31kB ± 0%      3.44kB ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):root_only_is_valid-2                         5.75kB ± 0%                   15.92kB ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):missing_root_entry-2                         2.79kB ± 0%   4.10kB ± 0%      7.82kB ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):invalid_entry_key-2                          8.45kB ± 0%   6.58kB ± 0%     23.19kB ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):missing_storage_in_entry-2                   2.20kB ± 0%   5.01kB ± 0%      7.05kB ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):missing_storage_type-2                       7.26kB ± 0%   5.42kB ± 0%     16.39kB ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):storage_type_should_be_a_string-2            8.30kB ± 0%   5.42kB ± 0%     18.22kB ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):storage_device_should_match_pattern-2        8.90kB ± 0%   5.44kB ± 0%     19.09kB ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):valid_array_from_z-schema_benchmark-2              6.66kB ± 0%  13.68kB ± 0%     10.54kB ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):not_array-2                                        2.65kB ± 0%   2.31kB ± 0%      3.44kB ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):array_of_not_onjects-2                             2.02kB ± 0%   3.64kB ± 0%      4.19kB ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):missing_required_properties-2                      1.50kB ± 0%   3.38kB ± 0%      3.58kB ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):required_property_of_wrong_type-2                  1.81kB ± 0%   4.78kB ± 0%      2.91kB ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):smallest_valid_product-2                           1.52kB ± 0%   4.55kB ± 0%      2.34kB ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):tags_should_be_array-2                             1.96kB ± 0%   5.08kB ± 0%      3.32kB ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):dimensions_should_be_object-2                      2.00kB ± 0%   5.09kB ± 0%      3.38kB ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):valid_product_with_tag-2                           1.66kB ± 0%   5.30kB ± 0%      3.02kB ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):dimensions_miss_required_properties-2              2.32kB ± 0%   6.56kB ± 0%      5.73kB ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):valid_product_with_tag_and_dimensions-2            2.32kB ± 0%   7.15kB ± 0%      4.43kB ± 0%
Ajv/complex.json:complex_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):valid_array_from_jsck_benchmark-2                  37.0kB ± 0%                    60.3kB ± 0%
Ajv/complex.json:complex_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):not_array-2                                        2.65kB ± 0%   2.31kB ± 0%      3.44kB ± 0%
Ajv/complex2.json:complex_schema_from_jsck_benchmark_without_IDs_in_definitions:valid_array_from_jsck_benchmark-2                            37.0kB ± 0%                    60.3kB ± 0%
Ajv/complex2.json:complex_schema_from_jsck_benchmark_without_IDs_in_definitions:not_array-2                                                  2.65kB ± 0%   2.31kB ± 0%      3.44kB ± 0%
Ajv/complex2.json:complex_schema_from_jsck_benchmark_without_IDs_in_definitions:one_valid_item-2                                             13.6kB ± 0%                    21.0kB ± 0%
Ajv/complex2.json:complex_schema_from_jsck_benchmark_without_IDs_in_definitions:one_invalid_item-2                                           15.3kB ± 0%    8.6kB ± 0%      23.3kB ± 0%
Ajv/complex3.json:complex_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):valid_array_from_jsck_benchmark-2                 37.0kB ± 0%                    60.3kB ± 0%
Ajv/complex3.json:complex_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):not_array-2                                       2.65kB ± 0%   2.33kB ± 0%      3.44kB ± 0%
Ajv/cosmicrealms.json:schema_from_cosmicrealms_benchmark:valid_data_from_cosmicrealms_benchmark-2                                            9.63kB ± 0%  16.76kB ± 0%     19.07kB ± 0%
Ajv/cosmicrealms.json:schema_from_cosmicrealms_benchmark:invalid_data-2                                                                      18.2kB ± 0%   20.4kB ± 0%      35.5kB ± 0%
Ajv/medium.json:medium_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):valid_object_from_jsck_benchmark-2                   5.34kB ± 0%  14.49kB ± 0%      6.83kB ± 0%
Ajv/medium.json:medium_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):not_object-2                                         2.65kB ± 0%   2.31kB ± 0%      3.44kB ± 0%
[Geo mean]                                                                                                                                   5.00kB        5.16kB           9.15kB     
Enter fullscreen mode Exit fullscreen mode

Draft 7 Alloc/Op

name \ alloc/op  santhosh-draft7.txt  qri-draft7.txt  xeipuuv-draft7.txt
[Geo mean]       1.94kB               3.06kB          2.90kB
Enter fullscreen mode Exit fullscreen mode

full benchstat report
name \ alloc/op                                                                                                                                      santhosh-draft7.txt  qri-draft7.txt  xeipuuv-draft7.txt
Draft7/additionalItems.json:additionalItems_as_schema:additional_items_match_schema-2                                                                        1.38kB ± 0%     3.87kB ± 0%         2.32kB ± 0%
Draft7/additionalItems.json:additionalItems_as_schema:additional_items_do_not_match_schema-2                                                                 1.55kB ± 0%     4.03kB ± 0%         2.87kB ± 0%
Draft7/additionalItems.json:items_is_schema,_no_additionalItems:all_items_match_schema-2                                                                     1.50kB ± 0%     3.44kB ± 0%         3.06kB ± 0%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:empty_array-2                                                                               976B ± 0%      2408B ± 0%          1136B ± 0%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:fewer_number_of_items_present_(1)-2                                                       1.05kB ± 0%     2.61kB ± 0%         1.49kB ± 0%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:fewer_number_of_items_present_(2)-2                                                       1.14kB ± 0%     2.82kB ± 0%         1.86kB ± 0%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:equal_number_of_items_present-2                                                           1.26kB ± 0%     3.07kB ± 0%         2.26kB ± 0%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:additional_items_are_not_permitted-2                                                      1.46kB ± 0%     3.14kB ± 0%         3.01kB ± 0%
Draft7/additionalItems.json:additionalItems_as_false_without_items:items_defaults_to_empty_schema_so_everything_is_valid-2                                   1.30kB ± 0%     2.48kB ± 0%         1.46kB ± 0%
Draft7/additionalItems.json:additionalItems_as_false_without_items:ignores_non-arrays-2                                                                      1.30kB ± 0%     2.53kB ± 0%         1.40kB ± 0%
Draft7/additionalItems.json:additionalItems_are_allowed_by_default:only_the_first_item_is_validated-2                                                        1.21kB ± 0%     2.73kB ± 0%         1.61kB ± 0%
Draft7/additionalItems.json:additionalItems_should_not_look_in_applicators,_valid_case:items_defined_in_allOf_are_not_examined-2                             1.12kB ± 0%                         1.62kB ± 0%
Draft7/additionalItems.json:additionalItems_should_not_look_in_applicators,_invalid_case:items_defined_in_allOf_are_not_examined-2                           1.47kB ± 0%                         2.95kB ± 0%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:no_additional_properties_is_valid-2                        1.35kB ± 0%     3.62kB ± 0%         2.68kB ± 0%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:an_additional_property_is_invalid-2                        1.67kB ± 0%     3.98kB ± 0%         5.74kB ± 0%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:ignores_arrays-2                                           1.14kB ± 0%     2.34kB ± 0%         1.30kB ± 0%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:ignores_strings-2                                          2.50kB ± 0%     2.19kB ± 0%         2.66kB ± 0%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:ignores_other_non-objects-2                                2.53kB ± 0%     2.18kB ± 0%         2.84kB ± 0%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:patternProperties_are_not_additional_properties-2          1.40kB ± 0%     3.95kB ± 0%         4.00kB ± 0%
Draft7/additionalProperties.json:non-ASCII_pattern_with_additionalProperties:matching_the_pattern_is_valid-2                                                 1.35kB ± 0%     3.52kB ± 0%         2.72kB ± 0%
Draft7/additionalProperties.json:non-ASCII_pattern_with_additionalProperties:not_matching_the_pattern_is_invalid-2                                           1.56kB ± 0%     2.95kB ± 0%         3.15kB ± 0%
Draft7/additionalProperties.json:additionalProperties_allows_a_schema_which_should_validate:no_additional_properties_is_valid-2                              1.34kB ± 0%     3.61kB ± 0%         1.69kB ± 0%
Draft7/additionalProperties.json:additionalProperties_allows_a_schema_which_should_validate:an_additional_valid_property_is_valid-2                          1.41kB ± 0%     4.02kB ± 0%         2.06kB ± 0%
Draft7/additionalProperties.json:additionalProperties_allows_a_schema_which_should_validate:an_additional_invalid_property_is_invalid-2                      1.67kB ± 0%     4.18kB ± 0%         2.99kB ± 0%
Draft7/additionalProperties.json:additionalProperties_can_exist_by_itself:an_additional_valid_property_is_valid-2                                            1.29kB ± 0%     3.33kB ± 0%         1.45kB ± 0%
Draft7/additionalProperties.json:additionalProperties_can_exist_by_itself:an_additional_invalid_property_is_invalid-2                                        1.54kB ± 0%     3.49kB ± 0%         2.38kB ± 0%
Draft7/additionalProperties.json:additionalProperties_are_allowed_by_default:additional_properties_are_allowed-2                                             1.41kB ± 0%     3.52kB ± 0%         2.00kB ± 0%
Draft7/additionalProperties.json:additionalProperties_should_not_look_in_applicators:properties_defined_in_allOf_are_not_examined-2                          1.59kB ± 0%                         2.76kB ± 0%
Draft7/allOf.json:allOf:allOf-2                                                                                                                              1.41kB ± 0%     5.54kB ± 0%         1.87kB ± 0%
Draft7/allOf.json:allOf:mismatch_second-2                                                                                                                    1.70kB ± 0%     4.82kB ± 0%         3.02kB ± 0%
Draft7/allOf.json:allOf:mismatch_first-2                                                                                                                     1.78kB ± 0%     4.81kB ± 0%         3.21kB ± 0%
Draft7/allOf.json:allOf:wrong_type-2                                                                                                                         1.78kB ± 0%     5.50kB ± 0%         3.17kB ± 0%
Draft7/allOf.json:allOf_with_base_schema:valid-2                                                                                                             1.41kB ± 0%     5.96kB ± 0%         1.90kB ± 0%
Draft7/allOf.json:allOf_with_base_schema:mismatch_base_schema-2                                                                                              1.52kB ± 0%     5.82kB ± 0%         2.32kB ± 0%
Draft7/allOf.json:allOf_with_base_schema:mismatch_first_allOf-2                                                                                              1.79kB ± 0%     5.55kB ± 0%         3.24kB ± 0%
Draft7/allOf.json:allOf_with_base_schema:mismatch_second_allOf-2                                                                                             1.81kB ± 0%     5.57kB ± 0%         3.33kB ± 0%
Draft7/allOf.json:allOf_with_base_schema:mismatch_both-2                                                                                                     2.36kB ± 0%     4.89kB ± 0%         3.98kB ± 0%
Draft7/allOf.json:allOf_simple_types:valid-2                                                                                                                 2.62kB ± 0%     3.06kB ± 0%         3.61kB ± 0%
Draft7/allOf.json:allOf_simple_types:mismatch_one-2                                                                                                          3.64kB ± 0%     3.24kB ± 0%         5.80kB ± 0%
Draft7/allOf.json:allOf_with_boolean_schemas,_all_true:any_value_is_valid-2                                                                                  2.48kB ± 0%     3.06kB ± 0%         2.71kB ± 0%
Draft7/allOf.json:allOf_with_boolean_schemas,_some_false:any_value_is_invalid-2                                                                              2.76kB ± 0%     3.22kB ± 0%         4.13kB ± 0%
Draft7/allOf.json:allOf_with_boolean_schemas,_all_false:any_value_is_invalid-2                                                                               3.22kB ± 0%     3.43kB ± 0%         4.88kB ± 0%
Draft7/allOf.json:allOf_with_one_empty_schema:any_data_is_valid-2                                                                                            2.56kB ± 0%     2.66kB ± 0%         3.12kB ± 0%
Draft7/allOf.json:allOf_with_two_empty_schemas:any_data_is_valid-2                                                                                           2.60kB ± 0%     3.05kB ± 0%         3.41kB ± 0%
Draft7/allOf.json:allOf_with_the_first_empty_schema:number_is_valid-2                                                                                        2.60kB ± 0%     3.05kB ± 0%         3.41kB ± 0%
Draft7/allOf.json:allOf_with_the_first_empty_schema:string_is_invalid-2                                                                                      2.83kB ± 0%     3.27kB ± 0%         4.29kB ± 0%
Draft7/allOf.json:allOf_with_the_last_empty_schema:number_is_valid-2                                                                                         2.60kB ± 0%     3.05kB ± 0%         3.41kB ± 0%
Draft7/allOf.json:allOf_with_the_last_empty_schema:string_is_invalid-2                                                                                       2.83kB ± 0%     3.27kB ± 0%         4.29kB ± 0%
Draft7/allOf.json:nested_allOf,_to_check_validation_semantics:null_is_valid-2                                                                                2.48kB ± 0%     3.17kB ± 0%         2.64kB ± 0%
Draft7/allOf.json:nested_allOf,_to_check_validation_semantics:anything_non-null_is_invalid-2                                                                 3.17kB ± 0%     3.42kB ± 0%         5.54kB ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_false,_anyOf:_false,_oneOf:_false-2                                                                6.24kB ± 0%     4.24kB ± 0%        10.62kB ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_false,_anyOf:_false,_oneOf:_true-2                                                                 5.10kB ± 0%     3.93kB ± 0%         8.35kB ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_false,_anyOf:_true,_oneOf:_false-2                                                                 5.10kB ± 0%     3.93kB ± 0%         8.35kB ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_false,_anyOf:_true,_oneOf:_true-2                                                                  3.91kB ± 0%     3.72kB ± 0%         6.15kB ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_true,_anyOf:_false,_oneOf:_false-2                                                                 5.21kB ± 0%     3.93kB ± 0%         8.43kB ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_true,_anyOf:_false,_oneOf:_true-2                                                                  4.01kB ± 0%     3.72kB ± 0%         6.23kB ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_true,_anyOf:_true,_oneOf:_false-2                                                                  3.98kB ± 0%     3.71kB ± 0%         6.22kB ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_true,_anyOf:_true,_oneOf:_true-2                                                                   2.96kB ± 0%     3.55kB ± 0%         4.04kB ± 0%
Draft7/anyOf.json:anyOf:first_anyOf_valid-2                                                                                                                  2.60kB ± 0%     2.55kB ± 0%         3.12kB ± 0%
Draft7/anyOf.json:anyOf:second_anyOf_valid-2                                                                                                                 3.02kB ± 0%     3.09kB ± 0%         4.36kB ± 0%
Draft7/anyOf.json:anyOf:both_anyOf_valid-2                                                                                                                   2.60kB ± 0%     2.55kB ± 0%         3.12kB ± 0%
Draft7/anyOf.json:anyOf:neither_anyOf_valid-2                                                                                                                4.02kB ± 0%     3.27kB ± 0%         6.49kB ± 0%
Draft7/anyOf.json:anyOf_with_base_schema:mismatch_base_schema-2                                                                                              2.65kB ± 0%     2.70kB ± 0%         3.44kB ± 0%
Draft7/anyOf.json:anyOf_with_base_schema:one_anyOf_valid-2                                                                                                   2.66kB ± 0%     3.08kB ± 0%         3.58kB ± 0%
Draft7/anyOf.json:anyOf_with_base_schema:both_anyOf_invalid-2                                                                                                3.14kB ± 0%     3.27kB ± 0%         5.04kB ± 0%
Draft7/anyOf.json:anyOf_with_boolean_schemas,_all_true:any_value_is_valid-2                                                                                  2.48kB ± 0%     2.56kB ± 0%         2.67kB ± 0%
Draft7/anyOf.json:anyOf_with_boolean_schemas,_some_true:any_value_is_valid-2                                                                                 2.48kB ± 0%     2.56kB ± 0%         2.67kB ± 0%
Draft7/anyOf.json:anyOf_with_boolean_schemas,_all_false:any_value_is_invalid-2                                                                               2.95kB ± 0%     3.20kB ± 0%         4.82kB ± 0%
Draft7/anyOf.json:anyOf_complex_types:first_anyOf_valid_(complex)-2                                                                                          1.38kB ± 0%     3.96kB ± 0%         1.72kB ± 0%
Draft7/anyOf.json:anyOf_complex_types:second_anyOf_valid_(complex)-2                                                                                         1.54kB ± 0%     4.64kB ± 0%         2.28kB ± 0%
Draft7/anyOf.json:anyOf_complex_types:both_anyOf_valid_(complex)-2                                                                                           1.41kB ± 0%     3.98kB ± 0%         1.74kB ± 0%
Draft7/anyOf.json:anyOf_complex_types:neither_anyOf_valid_(complex)-2                                                                                        2.18kB ± 0%     5.27kB ± 0%         3.98kB ± 0%
Draft7/anyOf.json:anyOf_with_one_empty_schema:string_is_valid-2                                                                                              2.67kB ± 0%     3.09kB ± 0%         3.55kB ± 0%
Draft7/anyOf.json:anyOf_with_one_empty_schema:number_is_valid-2                                                                                              2.58kB ± 0%     2.56kB ± 0%         3.13kB ± 0%
Draft7/anyOf.json:nested_anyOf,_to_check_validation_semantics:null_is_valid-2                                                                                2.48kB ± 0%     2.94kB ± 0%         2.64kB ± 0%
Draft7/anyOf.json:nested_anyOf,_to_check_validation_semantics:anything_non-null_is_invalid-2                                                                 3.18kB ± 0%     3.20kB ± 0%         5.51kB ± 0%
Draft7/anyOf.json:nested_anyOf,_to_check_validation_semantics:null_is_valid#01-2                                                                             2.48kB ± 0%     2.94kB ± 0%         2.64kB ± 0%
Draft7/anyOf.json:nested_anyOf,_to_check_validation_semantics:anything_non-null_is_invalid#01-2                                                              3.18kB ± 0%     3.20kB ± 0%         5.51kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':number_is_valid-2                                                                                           2.48kB ± 0%     2.17kB ± 0%         2.58kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':string_is_valid-2                                                                                           2.48kB ± 0%     2.18kB ± 0%         2.58kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':boolean_true_is_valid-2                                                                                     2.46kB ± 0%     2.16kB ± 0%         2.56kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':boolean_false_is_valid-2                                                                                    2.46kB ± 0%     2.16kB ± 0%         2.56kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':null_is_valid-2                                                                                             2.48kB ± 0%     2.18kB ± 0%         2.58kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':object_is_valid-2                                                                                           1.30kB ± 0%     2.53kB ± 0%         1.40kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':empty_object_is_valid-2                                                                                       992B ± 0%      2216B ± 0%          1088B ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':array_is_valid-2                                                                                            1.02kB ± 0%     2.24kB ± 0%         1.11kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':empty_array_is_valid-2                                                                                        976B ± 0%      2200B ± 0%          1072B ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':number_is_invalid-2                                                                                        2.59kB ± 0%     2.26kB ± 0%         3.26kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':string_is_invalid-2                                                                                        2.59kB ± 0%     2.27kB ± 0%         3.26kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':boolean_true_is_invalid-2                                                                                  2.58kB ± 0%     2.26kB ± 0%         3.25kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':boolean_false_is_invalid-2                                                                                 2.58kB ± 0%     2.26kB ± 0%         3.25kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':null_is_invalid-2                                                                                          2.59kB ± 0%     2.27kB ± 0%         3.26kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':object_is_invalid-2                                                                                        1.42kB ± 0%     2.62kB ± 0%         2.09kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':empty_object_is_invalid-2                                                                                  1.10kB ± 0%     2.31kB ± 0%         1.78kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':array_is_invalid-2                                                                                         1.12kB ± 0%     2.34kB ± 0%         1.79kB ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':empty_array_is_invalid-2                                                                                   1.09kB ± 0%     2.30kB ± 0%         1.76kB ± 0%
Draft7/const.json:const_validation:same_value_is_valid-2                                                                                                     2.60kB ± 0%     2.37kB ± 0%         3.09kB ± 0%
Draft7/const.json:const_validation:another_value_is_invalid-2                                                                                                2.75kB ± 0%     2.48kB ± 0%         3.86kB ± 0%
Draft7/const.json:const_validation:another_type_is_invalid-2                                                                                                 2.63kB ± 0%     2.49kB ± 0%         3.68kB ± 0%
Draft7/const.json:const_with_object:same_object_is_valid-2                                                                                                   1.33kB ± 0%     3.38kB ± 0%         3.03kB ± 0%
Draft7/const.json:const_with_object:same_object_with_different_property_order_is_valid-2                                                                     1.33kB ± 0%     3.38kB ± 0%         3.03kB ± 0%
Draft7/const.json:const_with_object:another_object_is_invalid-2                                                                                              1.44kB ± 0%     3.75kB ± 0%         3.34kB ± 0%
Draft7/const.json:const_with_object:another_type_is_invalid-2                                                                                                1.19kB ± 0%     3.49kB ± 0%         2.37kB ± 0%
Draft7/const.json:const_with_array:same_array_is_valid-2                                                                                                     1.38kB ± 0%     3.39kB ± 0%         2.76kB ± 0%
Draft7/const.json:const_with_array:another_array_item_is_invalid-2                                                                                           1.14kB ± 0%     3.25kB ± 0%         2.27kB ± 0%
Draft7/const.json:const_with_array:array_with_additional_items_is_invalid-2                                                                                  1.27kB ± 0%     3.36kB ± 0%         2.52kB ± 0%
Draft7/const.json:const_with_null:null_is_valid-2                                                                                                            2.48kB ± 0%     2.38kB ± 0%         2.86kB ± 0%
Draft7/const.json:const_with_null:not_null_is_invalid-2                                                                                                      2.66kB ± 0%     2.49kB ± 0%         3.78kB ± 0%
Draft7/const.json:const_with_false_does_not_match_0:false_is_valid-2                                                                                         2.46kB ± 0%     2.35kB ± 0%         2.82kB ± 0%
Draft7/const.json:const_with_false_does_not_match_0:integer_zero_is_invalid-2                                                                                2.66kB ± 0%     2.47kB ± 0%         3.78kB ± 0%
Draft7/const.json:const_with_false_does_not_match_0:float_zero_is_invalid-2                                                                                  2.67kB ± 0%     2.47kB ± 0%         3.81kB ± 0%
Draft7/const.json:const_with_true_does_not_match_1:true_is_valid-2                                                                                           2.46kB ± 0%     2.35kB ± 0%         2.82kB ± 0%
Draft7/const.json:const_with_true_does_not_match_1:integer_one_is_invalid-2                                                                                  2.67kB ± 0%     2.48kB ± 0%         3.86kB ± 0%
Draft7/const.json:const_with_true_does_not_match_1:float_one_is_invalid-2                                                                                    2.78kB ± 0%     2.48kB ± 0%         3.97kB ± 0%
Draft7/const.json:const_with_[false]_does_not_match_[0]:[false]_is_valid-2                                                                                     992B ± 0%      2464B ± 0%          1472B ± 0%
Draft7/const.json:const_with_[false]_does_not_match_[0]:[0]_is_invalid-2                                                                                     1.14kB ± 0%     2.60kB ± 0%         2.26kB ± 0%
Draft7/const.json:const_with_[false]_does_not_match_[0]:[0.0]_is_invalid-2                                                                                   1.15kB ± 0%     2.61kB ± 0%         2.27kB ± 0%
Draft7/const.json:const_with_[true]_does_not_match_[1]:[true]_is_valid-2                                                                                       992B ± 0%      2464B ± 0%          1472B ± 0%
Draft7/const.json:const_with_[true]_does_not_match_[1]:[1]_is_invalid-2                                                                                      1.14kB ± 0%     2.61kB ± 0%         2.26kB ± 0%
Draft7/const.json:const_with_[true]_does_not_match_[1]:[1.0]_is_invalid-2                                                                                    1.15kB ± 0%     2.62kB ± 0%         2.27kB ± 0%
Draft7/const.json:const_with_{"a":_false}_does_not_match_{"a":_0}:{"a":_false}_is_valid-2                                                                    1.28kB ± 0%     3.22kB ± 0%         2.50kB ± 0%
Draft7/const.json:const_with_{"a":_false}_does_not_match_{"a":_0}:{"a":_0}_is_invalid-2                                                                      1.43kB ± 0%     3.62kB ± 0%         3.26kB ± 0%
Draft7/const.json:const_with_{"a":_false}_does_not_match_{"a":_0}:{"a":_0.0}_is_invalid-2                                                                    1.44kB ± 0%     3.62kB ± 0%         3.30kB ± 0%
Draft7/const.json:const_with_{"a":_true}_does_not_match_{"a":_1}:{"a":_true}_is_valid-2                                                                      1.28kB ± 0%     3.22kB ± 0%         2.50kB ± 0%
Draft7/const.json:const_with_{"a":_true}_does_not_match_{"a":_1}:{"a":_1}_is_invalid-2                                                                       1.43kB ± 0%     3.62kB ± 0%         3.27kB ± 0%
Draft7/const.json:const_with_{"a":_true}_does_not_match_{"a":_1}:{"a":_1.0}_is_invalid-2                                                                                     3.63kB ± 0%         3.31kB ± 0%
Draft7/const.json:const_with_0_does_not_match_other_zero-like_types:false_is_invalid-2                                                                                       2.46kB ± 0%
Draft7/const.json:const_with_0_does_not_match_other_zero-like_types:integer_zero_is_valid-2                                                                                  2.35kB ± 0%
Draft7/const.json:const_with_0_does_not_match_other_zero-like_types:float_zero_is_valid-2                                                                                    2.35kB ± 0%
Draft7/const.json:const_with_0_does_not_match_other_zero-like_types:empty_object_is_invalid-2                                                                                2.52kB ± 0%
[Geo mean]                                                                                                                                                   1.94kB          3.06kB              2.90kB     
Enter fullscreen mode Exit fullscreen mode

AJV Suite Allocs/Op

name \ allocs/op  santhosh-ajv.txt  qri-ajv.txt   xeipuuv-ajv.txt
[Geo mean]        73.2              77.7          182.6     

Enter fullscreen mode Exit fullscreen mode

xeipuuv/gojsonschema is less optimized for allocations which leads to higher memory consumption and latency.

full benchstat report
name \ allocs/op                                                                                                                        santhosh-ajv.txt  qri-ajv.txt   xeipuuv-ajv.txt
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):valid_object_from_z-schema_benchmark-2          495 ± 0%                      1366 ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):not_object-2                                   11.0 ± 0%     22.0 ± 0%        34.0 ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):root_only_is_valid-2                            125 ± 0%                       331 ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):missing_root_entry-2                           49.0 ± 0%     54.0 ± 0%       118.0 ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):invalid_entry_key-2                             154 ± 0%      113 ± 0%         422 ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):missing_storage_in_entry-2                     38.0 ± 0%     80.0 ± 0%       107.0 ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):missing_storage_type-2                          195 ± 0%       87 ± 0%         309 ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):storage_type_should_be_a_string-2               218 ± 0%       88 ± 0%         362 ± 0%
Ajv/advanced.json:advanced_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):storage_device_should_match_pattern-2           234 ± 0%       88 ± 0%         378 ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):valid_array_from_z-schema_benchmark-2                 137 ± 0%      280 ± 0%         322 ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):not_array-2                                          11.0 ± 0%     22.0 ± 0%        34.0 ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):array_of_not_onjects-2                               42.0 ± 0%     61.0 ± 0%       102.0 ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):missing_required_properties-2                        30.0 ± 0%     47.0 ± 0%        70.0 ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):required_property_of_wrong_type-2                    34.0 ± 0%     78.0 ± 0%        69.0 ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):smallest_valid_product-2                             25.0 ± 0%     69.0 ± 0%        65.0 ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):tags_should_be_array-2                               41.0 ± 0%     89.0 ± 0%        90.0 ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):dimensions_should_be_object-2                        41.0 ± 0%     89.0 ± 0%        90.0 ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):valid_product_with_tag-2                             32.0 ± 0%     93.0 ± 0%        92.0 ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):dimensions_miss_required_properties-2                56.0 ± 0%    127.0 ± 0%       147.0 ± 0%
Ajv/basic.json:basic_schema_from_z-schema_benchmark_(https://github.com/zaggino/z-schema):valid_product_with_tag_and_dimensions-2              54.0 ± 0%    140.0 ± 0%       154.0 ± 0%
Ajv/complex.json:complex_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):valid_array_from_jsck_benchmark-2                     579 ± 0%                      1634 ± 0%
Ajv/complex.json:complex_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):not_array-2                                          11.0 ± 0%     22.0 ± 0%        34.0 ± 0%
Ajv/complex2.json:complex_schema_from_jsck_benchmark_without_IDs_in_definitions:valid_array_from_jsck_benchmark-2                               579 ± 0%                      1634 ± 0%
Ajv/complex2.json:complex_schema_from_jsck_benchmark_without_IDs_in_definitions:not_array-2                                                    11.0 ± 0%     22.0 ± 0%        34.0 ± 0%
Ajv/complex2.json:complex_schema_from_jsck_benchmark_without_IDs_in_definitions:one_valid_item-2                                                195 ± 0%                       529 ± 0%
Ajv/complex2.json:complex_schema_from_jsck_benchmark_without_IDs_in_definitions:one_invalid_item-2                                              255 ± 0%      165 ± 0%         576 ± 0%
Ajv/complex3.json:complex_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):valid_array_from_jsck_benchmark-2                    579 ± 0%                      1634 ± 0%
Ajv/complex3.json:complex_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):not_array-2                                         11.0 ± 0%     23.0 ± 0%        34.0 ± 0%
Ajv/cosmicrealms.json:schema_from_cosmicrealms_benchmark:valid_data_from_cosmicrealms_benchmark-2                                               212 ± 0%      375 ± 0%         574 ± 0%
Ajv/cosmicrealms.json:schema_from_cosmicrealms_benchmark:invalid_data-2                                                                         432 ± 0%      439 ± 0%         821 ± 0%
Ajv/medium.json:medium_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):valid_object_from_jsck_benchmark-2                     69.0 ± 0%    240.0 ± 0%       136.0 ± 0%
Ajv/medium.json:medium_schema_from_jsck_benchmark_(https://github.com/pandastrike/jsck):not_object-2                                           11.0 ± 0%     22.0 ± 0%        34.0 ± 0%
[Geo mean]                                                                                                                                     73.2          77.7            182.6     
Enter fullscreen mode Exit fullscreen mode

Draft 7 Allocs/Op

name \ allocs/op   santhosh-draft7.txt  qri-draft7.txt  xeipuuv-draft7.txt
[Geo mean]         15.1                 35.6            40.2     
Enter fullscreen mode Exit fullscreen mode

full benchstat report
name \ allocs/op                                                                                                                                     santhosh-draft7.txt  qri-draft7.txt  xeipuuv-draft7.txt
Draft7/additionalItems.json:additionalItems_as_schema:additional_items_match_schema-2                                                                          25.0 ± 0%       60.0 ± 0%           71.0 ± 0%
Draft7/additionalItems.json:additionalItems_as_schema:additional_items_do_not_match_schema-2                                                                   30.0 ± 0%       67.0 ± 0%           77.0 ± 0%
Draft7/additionalItems.json:items_is_schema,_no_additionalItems:all_items_match_schema-2                                                                       26.0 ± 0%       56.0 ± 0%          106.0 ± 0%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:empty_array-2                                                                               7.00 ± 0%      21.00 ± 0%          12.00 ± 0%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:fewer_number_of_items_present_(1)-2                                                         11.0 ± 0%       29.0 ± 0%           31.0 ± 0%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:fewer_number_of_items_present_(2)-2                                                         15.0 ± 0%       37.0 ± 0%           50.0 ± 0%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:equal_number_of_items_present-2                                                             19.0 ± 0%       45.0 ± 0%           69.0 ± 0%
Draft7/additionalItems.json:array_of_items_with_no_additionalItems:additional_items_are_not_permitted-2                                                        24.0 ± 0%       48.0 ± 0%           85.0 ± 0%
Draft7/additionalItems.json:additionalItems_as_false_without_items:items_defaults_to_empty_schema_so_everything_is_valid-2                                     16.0 ± 0%       27.0 ± 0%           21.0 ± 0%
Draft7/additionalItems.json:additionalItems_as_false_without_items:ignores_non-arrays-2                                                                        11.0 ± 0%       22.0 ± 0%           14.0 ± 0%
Draft7/additionalItems.json:additionalItems_are_allowed_by_default:only_the_first_item_is_validated-2                                                          17.0 ± 0%       33.0 ± 0%           35.0 ± 0%
Draft7/additionalItems.json:additionalItems_should_not_look_in_applicators,_valid_case:items_defined_in_allOf_are_not_examined-2                               14.0 ± 0%                           35.0 ± 0%
Draft7/additionalItems.json:additionalItems_should_not_look_in_applicators,_invalid_case:items_defined_in_allOf_are_not_examined-2                             28.0 ± 0%                           82.0 ± 0%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:no_additional_properties_is_valid-2                          12.0 ± 0%       42.0 ± 0%           42.0 ± 0%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:an_additional_property_is_invalid-2                          27.0 ± 0%       59.0 ± 0%          106.0 ± 0%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:ignores_arrays-2                                             13.0 ± 0%       24.0 ± 0%           18.0 ± 0%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:ignores_strings-2                                            7.00 ± 0%      18.00 ± 0%          14.00 ± 0%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:ignores_other_non-objects-2                                  10.0 ± 0%       18.0 ± 0%           25.0 ± 0%
Draft7/additionalProperties.json:additionalProperties_being_false_does_not_allow_other_properties:patternProperties_are_not_additional_properties-2            16.0 ± 0%       51.0 ± 0%           74.0 ± 0%
Draft7/additionalProperties.json:non-ASCII_pattern_with_additionalProperties:matching_the_pattern_is_valid-2                                                   12.0 ± 0%       38.0 ± 0%           43.0 ± 0%
Draft7/additionalProperties.json:non-ASCII_pattern_with_additionalProperties:not_matching_the_pattern_is_invalid-2                                             18.0 ± 0%       32.0 ± 0%           43.0 ± 0%
Draft7/additionalProperties.json:additionalProperties_allows_a_schema_which_should_validate:no_additional_properties_is_valid-2                                12.0 ± 0%       41.0 ± 0%           29.0 ± 0%
Draft7/additionalProperties.json:additionalProperties_allows_a_schema_which_should_validate:an_additional_valid_property_is_valid-2                            17.0 ± 0%       57.0 ± 0%           50.0 ± 0%
Draft7/additionalProperties.json:additionalProperties_allows_a_schema_which_should_validate:an_additional_invalid_property_is_invalid-2                        27.0 ± 0%       65.0 ± 0%           78.0 ± 0%
Draft7/additionalProperties.json:additionalProperties_can_exist_by_itself:an_additional_valid_property_is_valid-2                                              9.00 ± 0%      35.00 ± 0%          14.00 ± 0%
Draft7/additionalProperties.json:additionalProperties_can_exist_by_itself:an_additional_invalid_property_is_invalid-2                                          18.0 ± 0%       42.0 ± 0%           41.0 ± 0%
Draft7/additionalProperties.json:additionalProperties_are_allowed_by_default:additional_properties_are_allowed-2                                               17.0 ± 0%       44.0 ± 0%           48.0 ± 0%
Draft7/additionalProperties.json:additionalProperties_should_not_look_in_applicators:properties_defined_in_allOf_are_not_examined-2                            21.0 ± 0%                           61.0 ± 0%
Draft7/allOf.json:allOf:allOf-2                                                                                                                                17.0 ± 0%       74.0 ± 0%           39.0 ± 0%
Draft7/allOf.json:allOf:mismatch_second-2                                                                                                                      27.0 ± 0%       66.0 ± 0%           53.0 ± 0%
Draft7/allOf.json:allOf:mismatch_first-2                                                                                                                       30.0 ± 0%       65.0 ± 0%           63.0 ± 0%
Draft7/allOf.json:allOf:wrong_type-2                                                                                                                           30.0 ± 0%       83.0 ± 0%           59.0 ± 0%
Draft7/allOf.json:allOf_with_base_schema:valid-2                                                                                                               18.0 ± 0%       85.0 ± 0%           41.0 ± 0%
Draft7/allOf.json:allOf_with_base_schema:mismatch_base_schema-2                                                                                                21.0 ± 0%       79.0 ± 0%           40.0 ± 0%
Draft7/allOf.json:allOf_with_base_schema:mismatch_first_allOf-2                                                                                                31.0 ± 0%       78.0 ± 0%           65.0 ± 0%
Draft7/allOf.json:allOf_with_base_schema:mismatch_second_allOf-2                                                                                               33.0 ± 0%       80.0 ± 0%           71.0 ± 0%
Draft7/allOf.json:allOf_with_base_schema:mismatch_both-2                                                                                                       50.0 ± 0%       71.0 ± 0%           81.0 ± 0%
Draft7/allOf.json:allOf_simple_types:valid-2                                                                                                                   16.0 ± 0%       40.0 ± 0%           61.0 ± 0%
Draft7/allOf.json:allOf_simple_types:mismatch_one-2                                                                                                            47.0 ± 0%       46.0 ± 0%          115.0 ± 0%
Draft7/allOf.json:allOf_with_boolean_schemas,_all_true:any_value_is_valid-2                                                                                    7.00 ± 0%      40.00 ± 0%          16.00 ± 0%
Draft7/allOf.json:allOf_with_boolean_schemas,_some_false:any_value_is_invalid-2                                                                                16.0 ± 0%       45.0 ± 0%           45.0 ± 0%
Draft7/allOf.json:allOf_with_boolean_schemas,_all_false:any_value_is_invalid-2                                                                                 29.0 ± 0%       50.0 ± 0%           60.0 ± 0%
Draft7/allOf.json:allOf_with_one_empty_schema:any_data_is_valid-2                                                                                              10.0 ± 0%       30.0 ± 0%           40.0 ± 0%
Draft7/allOf.json:allOf_with_two_empty_schemas:any_data_is_valid-2                                                                                             12.0 ± 0%       39.0 ± 0%           56.0 ± 0%
Draft7/allOf.json:allOf_with_the_first_empty_schema:number_is_valid-2                                                                                          12.0 ± 0%       39.0 ± 0%           56.0 ± 0%
Draft7/allOf.json:allOf_with_the_first_empty_schema:string_is_invalid-2                                                                                        19.0 ± 0%       47.0 ± 0%           54.0 ± 0%
Draft7/allOf.json:allOf_with_the_last_empty_schema:number_is_valid-2                                                                                           12.0 ± 0%       39.0 ± 0%           56.0 ± 0%
Draft7/allOf.json:allOf_with_the_last_empty_schema:string_is_invalid-2                                                                                         19.0 ± 0%       47.0 ± 0%           54.0 ± 0%
Draft7/allOf.json:nested_allOf,_to_check_validation_semantics:null_is_valid-2                                                                                  6.00 ± 0%      43.00 ± 0%          11.00 ± 0%
Draft7/allOf.json:nested_allOf,_to_check_validation_semantics:anything_non-null_is_invalid-2                                                                   33.0 ± 0%       53.0 ± 0%           97.0 ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_false,_anyOf:_false,_oneOf:_false-2                                                                   122 ± 0%         70 ± 0%            244 ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_false,_anyOf:_false,_oneOf:_true-2                                                                   88.0 ± 0%       64.0 ± 0%          191.0 ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_false,_anyOf:_true,_oneOf:_false-2                                                                   88.0 ± 0%       64.0 ± 0%          191.0 ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_false,_anyOf:_true,_oneOf:_true-2                                                                    56.0 ± 0%       59.0 ± 0%          139.0 ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_true,_anyOf:_false,_oneOf:_false-2                                                                   90.0 ± 0%       64.0 ± 0%          191.0 ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_true,_anyOf:_false,_oneOf:_true-2                                                                    58.0 ± 0%       59.0 ± 0%          139.0 ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_true,_anyOf:_true,_oneOf:_false-2                                                                    53.0 ± 0%       58.0 ± 0%          138.0 ± 0%
Draft7/allOf.json:allOf_combined_with_anyOf,_oneOf:allOf:_true,_anyOf:_true,_oneOf:_true-2                                                                     25.0 ± 0%       53.0 ± 0%           85.0 ± 0%
Draft7/anyOf.json:anyOf:first_anyOf_valid-2                                                                                                                    12.0 ± 0%       26.0 ± 0%           40.0 ± 0%
Draft7/anyOf.json:anyOf:second_anyOf_valid-2                                                                                                                   28.0 ± 0%       41.0 ± 0%           74.0 ± 0%
Draft7/anyOf.json:anyOf:both_anyOf_valid-2                                                                                                                     12.0 ± 0%       26.0 ± 0%           40.0 ± 0%
Draft7/anyOf.json:anyOf:neither_anyOf_valid-2                                                                                                                  63.0 ± 0%       47.0 ± 0%          128.0 ± 0%
Draft7/anyOf.json:anyOf_with_base_schema:mismatch_base_schema-2                                                                                                11.0 ± 0%       31.0 ± 0%           34.0 ± 0%
Draft7/anyOf.json:anyOf_with_base_schema:one_anyOf_valid-2                                                                                                     12.0 ± 0%       40.0 ± 0%           40.0 ± 0%
Draft7/anyOf.json:anyOf_with_base_schema:both_anyOf_invalid-2                                                                                                  27.0 ± 0%       46.0 ± 0%           71.0 ± 0%
Draft7/anyOf.json:anyOf_with_boolean_schemas,_all_true:any_value_is_valid-2                                                                                    7.00 ± 0%      27.00 ± 0%          15.00 ± 0%
Draft7/anyOf.json:anyOf_with_boolean_schemas,_some_true:any_value_is_valid-2                                                                                   7.00 ± 0%      27.00 ± 0%          15.00 ± 0%
Draft7/anyOf.json:anyOf_with_boolean_schemas,_all_false:any_value_is_invalid-2                                                                                 23.0 ± 0%       44.0 ± 0%           59.0 ± 0%
Draft7/anyOf.json:anyOf_complex_types:first_anyOf_valid_(complex)-2                                                                                            14.0 ± 0%       44.0 ± 0%           30.0 ± 0%
Draft7/anyOf.json:anyOf_complex_types:second_anyOf_valid_(complex)-2                                                                                           21.0 ± 0%       60.0 ± 0%           38.0 ± 0%
Draft7/anyOf.json:anyOf_complex_types:both_anyOf_valid_(complex)-2                                                                                             17.0 ± 0%       47.0 ± 0%           33.0 ± 0%
Draft7/anyOf.json:anyOf_complex_types:neither_anyOf_valid_(complex)-2                                                                                          43.0 ± 0%       84.0 ± 0%           79.0 ± 0%
Draft7/anyOf.json:anyOf_with_one_empty_schema:string_is_valid-2                                                                                                13.0 ± 0%       41.0 ± 0%           39.0 ± 0%
Draft7/anyOf.json:anyOf_with_one_empty_schema:number_is_valid-2                                                                                                13.0 ± 0%       27.0 ± 0%           41.0 ± 0%
Draft7/anyOf.json:nested_anyOf,_to_check_validation_semantics:null_is_valid-2                                                                                  6.00 ± 0%      35.00 ± 0%          11.00 ± 0%
Draft7/anyOf.json:nested_anyOf,_to_check_validation_semantics:anything_non-null_is_invalid-2                                                                   36.0 ± 0%       45.0 ± 0%           97.0 ± 0%
Draft7/anyOf.json:nested_anyOf,_to_check_validation_semantics:null_is_valid#01-2                                                                               6.00 ± 0%      35.00 ± 0%          11.00 ± 0%
Draft7/anyOf.json:nested_anyOf,_to_check_validation_semantics:anything_non-null_is_invalid#01-2                                                                36.0 ± 0%       45.0 ± 0%           97.0 ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':number_is_valid-2                                                                                             6.00 ± 0%      17.00 ± 0%           9.00 ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':string_is_valid-2                                                                                             7.00 ± 0%      18.00 ± 0%          10.00 ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':boolean_true_is_valid-2                                                                                       5.00 ± 0%      16.00 ± 0%           8.00 ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':boolean_false_is_valid-2                                                                                      5.00 ± 0%      16.00 ± 0%           8.00 ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':null_is_valid-2                                                                                               6.00 ± 0%      17.00 ± 0%           9.00 ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':object_is_valid-2                                                                                             11.0 ± 0%       22.0 ± 0%           14.0 ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':empty_object_is_valid-2                                                                                       7.00 ± 0%      18.00 ± 0%          10.00 ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':array_is_valid-2                                                                                              10.0 ± 0%       21.0 ± 0%           13.0 ± 0%
Draft7/boolean_schema.json:boolean_schema_'true':empty_array_is_valid-2                                                                                        7.00 ± 0%      18.00 ± 0%          10.00 ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':number_is_invalid-2                                                                                          8.00 ± 0%      20.00 ± 0%          23.00 ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':string_is_invalid-2                                                                                          9.00 ± 0%      21.00 ± 0%          24.00 ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':boolean_true_is_invalid-2                                                                                    7.00 ± 0%      19.00 ± 0%          22.00 ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':boolean_false_is_invalid-2                                                                                   7.00 ± 0%      19.00 ± 0%          22.00 ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':null_is_invalid-2                                                                                            8.00 ± 0%      20.00 ± 0%          23.00 ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':object_is_invalid-2                                                                                          13.0 ± 0%       25.0 ± 0%           28.0 ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':empty_object_is_invalid-2                                                                                    9.00 ± 0%      21.00 ± 0%          24.00 ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':array_is_invalid-2                                                                                           12.0 ± 0%       24.0 ± 0%           27.0 ± 0%
Draft7/boolean_schema.json:boolean_schema_'false':empty_array_is_invalid-2                                                                                     9.00 ± 0%      21.00 ± 0%          24.00 ± 0%
Draft7/const.json:const_validation:same_value_is_valid-2                                                                                                       12.0 ± 0%       20.0 ± 0%           32.0 ± 0%
Draft7/const.json:const_validation:another_value_is_invalid-2                                                                                                  16.0 ± 0%       26.0 ± 0%           51.0 ± 0%
Draft7/const.json:const_validation:another_type_is_invalid-2                                                                                                   10.0 ± 0%       26.0 ± 0%           42.0 ± 0%
Draft7/const.json:const_with_object:same_object_is_valid-2                                                                                                     14.0 ± 0%       44.0 ± 0%           55.0 ± 0%
Draft7/const.json:const_with_object:same_object_with_different_property_order_is_valid-2                                                                       14.0 ± 0%       44.0 ± 0%           55.0 ± 0%
Draft7/const.json:const_with_object:another_object_is_invalid-2                                                                                                15.0 ± 0%       50.0 ± 0%           60.0 ± 0%
Draft7/const.json:const_with_object:another_type_is_invalid-2                                                                                                  15.0 ± 0%       50.0 ± 0%           50.0 ± 0%
Draft7/const.json:const_with_array:same_array_is_valid-2                                                                                                       15.0 ± 0%       41.0 ± 0%           50.0 ± 0%
Draft7/const.json:const_with_array:another_array_item_is_invalid-2                                                                                             13.0 ± 0%       44.0 ± 0%           46.0 ± 0%
Draft7/const.json:const_with_array:array_with_additional_items_is_invalid-2                                                                                    17.0 ± 0%       48.0 ± 0%           54.0 ± 0%
Draft7/const.json:const_with_null:null_is_valid-2                                                                                                              6.00 ± 0%      20.00 ± 0%          19.00 ± 0%
Draft7/const.json:const_with_null:not_null_is_invalid-2                                                                                                        11.0 ± 0%       26.0 ± 0%           42.0 ± 0%
Draft7/const.json:const_with_false_does_not_match_0:false_is_valid-2                                                                                           5.00 ± 0%      18.00 ± 0%          17.00 ± 0%
Draft7/const.json:const_with_false_does_not_match_0:integer_zero_is_invalid-2                                                                                  11.0 ± 0%       25.0 ± 0%           42.0 ± 0%
Draft7/const.json:const_with_false_does_not_match_0:float_zero_is_invalid-2                                                                                    13.0 ± 0%       26.0 ± 0%           45.0 ± 0%
Draft7/const.json:const_with_true_does_not_match_1:true_is_valid-2                                                                                             5.00 ± 0%      18.00 ± 0%          17.00 ± 0%
Draft7/const.json:const_with_true_does_not_match_1:integer_one_is_invalid-2                                                                                    12.0 ± 0%       26.0 ± 0%           51.0 ± 0%
Draft7/const.json:const_with_true_does_not_match_1:float_one_is_invalid-2                                                                                      17.0 ± 0%       27.0 ± 0%           56.0 ± 0%
Draft7/const.json:const_with_[false]_does_not_match_[0]:[false]_is_valid-2                                                                                     8.00 ± 0%      24.00 ± 0%          25.00 ± 0%
Draft7/const.json:const_with_[false]_does_not_match_[0]:[0]_is_invalid-2                                                                                       13.0 ± 0%       31.0 ± 0%           45.0 ± 0%
Draft7/const.json:const_with_[false]_does_not_match_[0]:[0.0]_is_invalid-2                                                                                     14.0 ± 0%       32.0 ± 0%           47.0 ± 0%
Draft7/const.json:const_with_[true]_does_not_match_[1]:[true]_is_valid-2                                                                                       8.00 ± 0%      24.00 ± 0%          25.00 ± 0%
Draft7/const.json:const_with_[true]_does_not_match_[1]:[1]_is_invalid-2                                                                                        13.0 ± 0%       32.0 ± 0%           46.0 ± 0%
Draft7/const.json:const_with_[true]_does_not_match_[1]:[1.0]_is_invalid-2                                                                                      14.0 ± 0%       33.0 ± 0%           48.0 ± 0%
Draft7/const.json:const_with_{"a":_false}_does_not_match_{"a":_0}:{"a":_false}_is_valid-2                                                                      8.00 ± 0%      29.00 ± 0%          35.00 ± 0%
Draft7/const.json:const_with_{"a":_false}_does_not_match_{"a":_0}:{"a":_0}_is_invalid-2                                                                        13.0 ± 0%       42.0 ± 0%           55.0 ± 0%
Draft7/const.json:const_with_{"a":_false}_does_not_match_{"a":_0}:{"a":_0.0}_is_invalid-2                                                                      14.0 ± 0%       43.0 ± 0%           57.0 ± 0%
Draft7/const.json:const_with_{"a":_true}_does_not_match_{"a":_1}:{"a":_true}_is_valid-2                                                                        8.00 ± 0%      29.00 ± 0%          35.00 ± 0%
Draft7/const.json:const_with_{"a":_true}_does_not_match_{"a":_1}:{"a":_1}_is_invalid-2                                                                         13.0 ± 0%       43.0 ± 0%           56.0 ± 0%
Draft7/const.json:const_with_{"a":_true}_does_not_match_{"a":_1}:{"a":_1.0}_is_invalid-2                                                                                       44.0 ± 0%           58.0 ± 0%
Draft7/const.json:const_with_0_does_not_match_other_zero-like_types:false_is_invalid-2                                                                                         24.0 ± 0%
Draft7/const.json:const_with_0_does_not_match_other_zero-like_types:integer_zero_is_valid-2                                                                                    18.0 ± 0%
Draft7/const.json:const_with_0_does_not_match_other_zero-like_types:float_zero_is_valid-2                                                                                      19.0 ± 0%
Draft7/const.json:const_with_0_does_not_match_other_zero-like_types:empty_object_is_invalid-2                                                                                  26.0 ± 0%
[Geo mean]                                                                                                                                                     15.1            35.6                40.2     
Enter fullscreen mode Exit fullscreen mode

Conclusion

If you want a fast validator, pick santhosh-tekuri/jsonschema or qri-io/jsonschema.

If you want a correct validator, pick santhosh-tekuri/jsonschema or xeipuuv/gojsonschema.

If you want a fast and correct validator, pick santhosh-tekuri/jsonschema.

Thank you for reading and keep your data valid! :)

Discussion (0)

pic
Editor guide