Skip to content

Commit

Permalink
Don't emit type: object if the schema also defines required (#230)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti authored Nov 25, 2024
1 parent 430c029 commit 8b4719e
Show file tree
Hide file tree
Showing 8 changed files with 283 additions and 25 deletions.
43 changes: 43 additions & 0 deletions src/compiler/compile_describe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,14 @@ struct DescribeVisitor {
return message.str();
}

auto operator()(const AssertionDefinesStrict &step) const -> std::string {
std::ostringstream message;
message
<< "The value was expected to be an object that defines the property "
<< escape_string(step_value(step));
return message.str();
}

auto operator()(const AssertionDefinesAll &step) const -> std::string {
const auto &value{step_value(step)};
assert(value.size() > 1);
Expand Down Expand Up @@ -906,6 +914,23 @@ struct DescribeVisitor {
return message.str();
}

auto operator()(const AssertionDefinesAllStrict &step) const -> std::string {
const auto &value{step_value(step)};
assert(value.size() > 1);
std::ostringstream message;
message
<< "The value was expected to be an object that defines properties ";
for (auto iterator = value.cbegin(); iterator != value.cend(); ++iterator) {
if (std::next(iterator) == value.cend()) {
message << "and " << escape_string(*iterator);
} else {
message << escape_string(*iterator) << ", ";
}
}

return message.str();
}

auto operator()(const AssertionDefinesExactly &step) const -> std::string {
const auto &value{step_value(step)};
assert(value.size() > 1);
Expand All @@ -922,6 +947,24 @@ struct DescribeVisitor {
return message.str();
}

auto operator()(const AssertionDefinesExactlyStrict &step) const
-> std::string {
const auto &value{step_value(step)};
assert(value.size() > 1);
std::ostringstream message;
message << "The value was expected to be an object that only defines "
"properties ";
for (auto iterator = value.cbegin(); iterator != value.cend(); ++iterator) {
if (std::next(iterator) == value.cend()) {
message << "and " << escape_string(*iterator);
} else {
message << escape_string(*iterator) << ", ";
}
}

return message.str();
}

auto operator()(const AssertionType &step) const -> std::string {
std::ostringstream message;
describe_type_check(this->valid, this->target.type(), step_value(step),
Expand Down
4 changes: 4 additions & 0 deletions src/compiler/compile_json.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,12 @@ struct StepVisitor {

HANDLE_STEP("assertion", "fail", AssertionFail)
HANDLE_STEP("assertion", "defines", AssertionDefines)
HANDLE_STEP("assertion", "defines-strict", AssertionDefinesStrict)
HANDLE_STEP("assertion", "defines-all", AssertionDefinesAll)
HANDLE_STEP("assertion", "defines-all-strict", AssertionDefinesAllStrict)
HANDLE_STEP("assertion", "defines-exactly", AssertionDefinesExactly)
HANDLE_STEP("assertion", "defines-exactly-strict",
AssertionDefinesExactlyStrict)
HANDLE_STEP("assertion", "property-dependencies",
AssertionPropertyDependencies)
HANDLE_STEP("assertion", "type", AssertionType)
Expand Down
38 changes: 35 additions & 3 deletions src/compiler/default_compiler_draft4.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ auto compiler_draft4_validation_type(const Context &context,
return {};
}

if (context.mode == Mode::FastValidation &&
schema_context.schema.defines("required")) {
return {};
}

return {make<AssertionTypeStrict>(
context, schema_context, dynamic_context,
sourcemeta::jsontoolkit::JSON::Type::Object)};
Expand Down Expand Up @@ -417,6 +422,11 @@ auto compiler_draft4_validation_required(const Context &context,
return {};
}

const auto assume_object{schema_context.schema.defines("type") &&
schema_context.schema.at("type").is_string() &&
schema_context.schema.at("type").to_string() ==
"object"};

if (schema_context.schema.at(dynamic_context.keyword).empty()) {
return {};
} else if (schema_context.schema.at(dynamic_context.keyword).size() > 1) {
Expand All @@ -428,8 +438,14 @@ auto compiler_draft4_validation_required(const Context &context,
}

if (properties.size() == 1) {
return {make<AssertionDefines>(context, schema_context, dynamic_context,
ValueString{*(properties.cbegin())})};
if (context.mode == Mode::FastValidation && assume_object) {
return {make<AssertionDefinesStrict>(
context, schema_context, dynamic_context,
ValueString{*(properties.cbegin())})};
} else {
return {make<AssertionDefines>(context, schema_context, dynamic_context,
ValueString{*(properties.cbegin())})};
}
} else if (schema_context.schema.defines("additionalProperties") &&
schema_context.schema.at("additionalProperties").is_boolean() &&
!schema_context.schema.at("additionalProperties").to_boolean() &&
Expand All @@ -442,12 +458,28 @@ auto compiler_draft4_validation_required(const Context &context,
return schema_context.schema.at("properties")
.defines(property);
})) {
return {make<AssertionDefinesExactly>(
if (context.mode == Mode::FastValidation && assume_object) {
return {make<AssertionDefinesExactlyStrict>(
context, schema_context, dynamic_context, std::move(properties))};
} else {
return {make<AssertionDefinesExactly>(
context, schema_context, dynamic_context, std::move(properties))};
}
} else if (context.mode == Mode::FastValidation && assume_object) {
return {make<AssertionDefinesAllStrict>(
context, schema_context, dynamic_context, std::move(properties))};
} else {
return {make<AssertionDefinesAll>(
context, schema_context, dynamic_context, std::move(properties))};
}
} else if (context.mode == Mode::FastValidation && assume_object) {
assert(
schema_context.schema.at(dynamic_context.keyword).front().is_string());
return {make<AssertionDefinesStrict>(
context, schema_context, dynamic_context,
ValueString{schema_context.schema.at(dynamic_context.keyword)
.front()
.to_string()})};
} else {
assert(
schema_context.schema.at(dynamic_context.keyword).front().is_string());
Expand Down
5 changes: 5 additions & 0 deletions src/compiler/default_compiler_draft6.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ auto compiler_draft6_validation_type(const Context &context,
return {};
}

if (context.mode == Mode::FastValidation &&
schema_context.schema.defines("required")) {
return {};
}

return {make<AssertionTypeStrict>(
context, schema_context, dynamic_context,
sourcemeta::jsontoolkit::JSON::Type::Object)};
Expand Down
48 changes: 48 additions & 0 deletions src/evaluator/dispatch.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ switch (static_cast<InstructionIndex>(instruction.index())) {
EVALUATE_END(assertion, AssertionDefines);
}

case IS_INSTRUCTION(AssertionDefinesStrict): {
EVALUATE_BEGIN_NO_PRECONDITION(assertion, AssertionDefinesStrict);
const auto &target{get(instance, assertion.relative_instance_location)};
result = target.is_object() && target.defines(assertion.value);
EVALUATE_END(assertion, AssertionDefinesStrict);
}

case IS_INSTRUCTION(AssertionDefinesAll): {
EVALUATE_BEGIN_NON_STRING(assertion, AssertionDefinesAll,
target.is_object());
Expand All @@ -47,6 +54,27 @@ switch (static_cast<InstructionIndex>(instruction.index())) {
EVALUATE_END(assertion, AssertionDefinesAll);
}

case IS_INSTRUCTION(AssertionDefinesAllStrict): {
EVALUATE_BEGIN_NO_PRECONDITION(assertion, AssertionDefinesAllStrict);
const auto &target{get(instance, assertion.relative_instance_location)};

// Otherwise we are we even emitting this instruction?
assert(assertion.value.size() > 1);

// Otherwise there is no way the instance can satisfy it anyway
if (target.is_object() && assertion.value.size() <= target.object_size()) {
result = true;
for (const auto &property : assertion.value) {
if (!target.defines(property)) {
result = false;
break;
}
}
}

EVALUATE_END(assertion, AssertionDefinesAllStrict);
}

case IS_INSTRUCTION(AssertionDefinesExactly): {
EVALUATE_BEGIN_NON_STRING(assertion, AssertionDefinesExactly,
target.is_object());
Expand All @@ -67,6 +95,26 @@ switch (static_cast<InstructionIndex>(instruction.index())) {
EVALUATE_END(assertion, AssertionDefinesExactly);
}

case IS_INSTRUCTION(AssertionDefinesExactlyStrict): {
EVALUATE_BEGIN_NO_PRECONDITION(assertion, AssertionDefinesExactlyStrict);
const auto &target{get(instance, assertion.relative_instance_location)};

// Otherwise we are we even emitting this instruction?
assert(assertion.value.size() > 1);

if (target.is_object() && assertion.value.size() == target.object_size()) {
result = true;
for (const auto &property : assertion.value) {
if (!target.defines(property)) {
result = false;
break;
}
}
}

EVALUATE_END(assertion, AssertionDefinesExactlyStrict);
}

case IS_INSTRUCTION(AssertionPropertyDependencies): {
EVALUATE_BEGIN_NON_STRING(assertion, AssertionPropertyDependencies,
target.is_object());
Expand Down
26 changes: 24 additions & 2 deletions src/evaluator/include/sourcemeta/blaze/evaluator_instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ namespace sourcemeta::blaze {
#ifndef DOXYGEN
struct AssertionFail;
struct AssertionDefines;
struct AssertionDefinesStrict;
struct AssertionDefinesAll;
struct AssertionDefinesAllStrict;
struct AssertionDefinesExactly;
struct AssertionDefinesExactlyStrict;
struct AssertionPropertyDependencies;
struct AssertionType;
struct AssertionTypeAny;
Expand Down Expand Up @@ -103,8 +106,9 @@ struct ControlDynamicAnchorJump;
/// @ingroup evaluator
/// Represents a schema compilation step that can be evaluated
using Instruction = std::variant<
AssertionFail, AssertionDefines, AssertionDefinesAll,
AssertionDefinesExactly, AssertionPropertyDependencies, AssertionType,
AssertionFail, AssertionDefines, AssertionDefinesStrict,
AssertionDefinesAll, AssertionDefinesAllStrict, AssertionDefinesExactly,
AssertionDefinesExactlyStrict, AssertionPropertyDependencies, AssertionType,
AssertionTypeAny, AssertionTypeStrict, AssertionTypeStrictAny,
AssertionTypeStringBounded, AssertionTypeStringUpper,
AssertionTypeArrayBounded, AssertionTypeArrayUpper,
Expand Down Expand Up @@ -139,8 +143,11 @@ using Instruction = std::variant<
enum class InstructionIndex : std::uint8_t {
AssertionFail = 0,
AssertionDefines,
AssertionDefinesStrict,
AssertionDefinesAll,
AssertionDefinesAllStrict,
AssertionDefinesExactly,
AssertionDefinesExactlyStrict,
AssertionPropertyDependencies,
AssertionType,
AssertionTypeAny,
Expand Down Expand Up @@ -264,16 +271,31 @@ DEFINE_STEP_WITH_VALUE(Assertion, Fail, ValueNone)
/// a given property
DEFINE_STEP_WITH_VALUE(Assertion, Defines, ValueString)

/// @ingroup evaluator_instructions
/// @brief Represents a compiler assertion step that checks that the instance is
/// an object and that it defines a given property
DEFINE_STEP_WITH_VALUE(Assertion, DefinesStrict, ValueString)

/// @ingroup evaluator_instructions
/// @brief Represents a compiler assertion step that checks if an object defines
/// a set of properties
DEFINE_STEP_WITH_VALUE(Assertion, DefinesAll, ValueStrings)

/// @ingroup evaluator_instructions
/// @brief Represents a compiler assertion step that checks that the instance is
/// an object and that it defines a set of properties
DEFINE_STEP_WITH_VALUE(Assertion, DefinesAllStrict, ValueStrings)

/// @ingroup evaluator_instructions
/// @brief Represents a compiler assertion step that checks if an object defines
/// a set of properties and no other ones
DEFINE_STEP_WITH_VALUE(Assertion, DefinesExactly, ValueStrings)

/// @ingroup evaluator_instructions
/// @brief Represents a compiler assertion step that checks if the instance is
/// an object and defines a set of properties and no other ones
DEFINE_STEP_WITH_VALUE(Assertion, DefinesExactlyStrict, ValueStrings)

/// @ingroup evaluator_instructions
/// @brief Represents a compiler assertion step that checks if an object defines
/// a set of properties if it defines other set of properties
Expand Down
Loading

5 comments on commit 8b4719e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (macos/llvm)

Benchmark suite Current: 8b4719e Previous: 430c029 Ratio
Compiler_Draft6_AdaptiveCard 37920277042.00007 ns/iter 31945984083.999973 ns/iter 1.19
Compiler_2019_09_OMC_JSON_V2 8424789833.999967 ns/iter 6738937749.999991 ns/iter 1.25
Evaluator_Draft4_Meta_1_No_Callback 295.32737113446024 ns/iter 246.8382329146238 ns/iter 1.20
Evaluator_Draft4_Required_Properties 356.10705116932024 ns/iter 327.3272211197626 ns/iter 1.09
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 20.176924601220097 ns/iter 18.247858427283248 ns/iter 1.11
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 10.99139091686531 ns/iter 10.034263341731172 ns/iter 1.10
Evaluator_Draft4_Items_Schema 339.5910327413362 ns/iter 316.189839628639 ns/iter 1.07
Evaluator_Draft4_Nested_Object 3.2024966049718504 ns/iter 2.8408528089456815 ns/iter 1.13
Evaluator_Draft4_Properties_Triad_Optional 880.7867958332611 ns/iter 763.192905894003 ns/iter 1.15
Evaluator_Draft4_Properties_Triad_Closed 750.6028070113639 ns/iter 640.8297535020363 ns/iter 1.17
Evaluator_Draft4_Properties_Triad_Required 928.3910322986816 ns/iter 769.1330145714551 ns/iter 1.21
Evaluator_Draft4_Properties_Closed 86.31555718906574 ns/iter 76.89916864523295 ns/iter 1.12
Evaluator_Draft4_Non_Recursive_Ref 12.051475945066107 ns/iter 10.369247829395693 ns/iter 1.16
Evaluator_Draft4_Pattern_Properties_True 208.75452465289897 ns/iter 169.83849565819853 ns/iter 1.23
Evaluator_Draft4_Ref_To_Single_Property 15.372524766334966 ns/iter 11.402031675007155 ns/iter 1.35
Evaluator_Draft4_Additional_Properties_Type 26.32798851061755 ns/iter 20.614279051446875 ns/iter 1.28
Evaluator_Draft4_Nested_Oneof 75.17694084750025 ns/iter 65.83022103422294 ns/iter 1.14
Evaluator_Draft4_Long_Enum 33.59953296713997 ns/iter 28.289926177591013 ns/iter 1.19
Evaluator_Draft4_Type_Object 7.421680185842277 ns/iter 5.971741555341765 ns/iter 1.24
Evaluator_Draft6_Property_Names 154.1858630239667 ns/iter 135.1928392998858 ns/iter 1.14
Evaluator_Draft7_If_Then_Else 30.786149761968105 ns/iter 27.002636156658376 ns/iter 1.14
Evaluator_Draft7_Vercel_1 76327.20547794462 ns/iter 73707.47096092744 ns/iter 1.04
Evaluator_Draft7_Helm_Chart_Lock_1 390.87678134342883 ns/iter 363.8689274382145 ns/iter 1.07
Evaluator_2019_09_Unevaluated_Properties 164.6575334728001 ns/iter 146.86898954602248 ns/iter 1.12
Evaluator_2019_09_OMC_JSON_V2_1 2597.369536565961 ns/iter 2640.9001760541296 ns/iter 0.98
Evaluator_2020_12_Dynamic_Ref 531.3445037477486 ns/iter 510.5133036652302 ns/iter 1.04

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/llvm)

Benchmark suite Current: 8b4719e Previous: 430c029 Ratio
Compiler_Draft6_AdaptiveCard 53188748945.99998 ns/iter 54472993869.000046 ns/iter 0.98
Compiler_2019_09_OMC_JSON_V2 10729548438.999985 ns/iter 10947622488.000036 ns/iter 0.98
Evaluator_Draft4_Meta_1_No_Callback 371.69911571784144 ns/iter 370.42743276715134 ns/iter 1.00
Evaluator_Draft4_Required_Properties 795.6163351446861 ns/iter 805.9124022419338 ns/iter 0.99
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 40.5028899089169 ns/iter 39.599436774735075 ns/iter 1.02
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 24.175276900136183 ns/iter 24.448766440010292 ns/iter 0.99
Evaluator_Draft4_Items_Schema 756.6559680139854 ns/iter 774.3958840830993 ns/iter 0.98
Evaluator_Draft4_Nested_Object 4.950802068340435 ns/iter 4.968472273267688 ns/iter 1.00
Evaluator_Draft4_Properties_Triad_Optional 1207.5436383550684 ns/iter 1169.375474938872 ns/iter 1.03
Evaluator_Draft4_Properties_Triad_Closed 1028.8095455436437 ns/iter 989.8063689023751 ns/iter 1.04
Evaluator_Draft4_Properties_Triad_Required 1234.8845232855035 ns/iter 1214.3062779000738 ns/iter 1.02
Evaluator_Draft4_Properties_Closed 140.46547353367595 ns/iter 135.5243919746008 ns/iter 1.04
Evaluator_Draft4_Non_Recursive_Ref 33.097990410926336 ns/iter 33.15896577921742 ns/iter 1.00
Evaluator_Draft4_Pattern_Properties_True 267.8242802210148 ns/iter 261.56737265773626 ns/iter 1.02
Evaluator_Draft4_Ref_To_Single_Property 24.514040384380763 ns/iter 24.858429058362987 ns/iter 0.99
Evaluator_Draft4_Additional_Properties_Type 62.184406754127565 ns/iter 68.91253553458229 ns/iter 0.90
Evaluator_Draft4_Nested_Oneof 136.9353509996092 ns/iter 131.12469231866598 ns/iter 1.04
Evaluator_Draft4_Long_Enum 21.668219562039333 ns/iter 22.361124463489958 ns/iter 0.97
Evaluator_Draft4_Type_Object 11.781611656746897 ns/iter 11.603297614112321 ns/iter 1.02
Evaluator_Draft6_Property_Names 261.5352904092567 ns/iter 241.51038566858912 ns/iter 1.08
Evaluator_Draft7_If_Then_Else 58.84885464888864 ns/iter 56.12409330724989 ns/iter 1.05
Evaluator_Draft7_Vercel_1 92461.52490322122 ns/iter 101086.67944251 ns/iter 0.91
Evaluator_Draft7_Helm_Chart_Lock_1 548.1957069926955 ns/iter 599.9060624427157 ns/iter 0.91
Evaluator_2019_09_Unevaluated_Properties 194.07555978031755 ns/iter 184.47926817252028 ns/iter 1.05
Evaluator_2019_09_OMC_JSON_V2_1 3512.5074251700375 ns/iter 3681.2035597729505 ns/iter 0.95
Evaluator_2020_12_Dynamic_Ref 855.849597243164 ns/iter 821.9084181044248 ns/iter 1.04

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/gcc)

Benchmark suite Current: 8b4719e Previous: 430c029 Ratio
Evaluator_2020_12_Dynamic_Ref 840.256249171575 ns/iter 841.1698616087093 ns/iter 1.00
Evaluator_2019_09_Unevaluated_Properties 238.34432027160105 ns/iter 239.8543509943509 ns/iter 0.99
Evaluator_2019_09_OMC_JSON_V2_1 4773.390318408501 ns/iter 5001.197865424614 ns/iter 0.95
Evaluator_Draft7_If_Then_Else 51.82787978228494 ns/iter 51.80797522675906 ns/iter 1.00
Evaluator_Draft7_Vercel_1 110497.7845070415 ns/iter 120309.02451956033 ns/iter 0.92
Evaluator_Draft7_Helm_Chart_Lock_1 650.0761146579374 ns/iter 718.2962026303906 ns/iter 0.91
Evaluator_Draft6_Property_Names 499.5693920296434 ns/iter 503.9667661644303 ns/iter 0.99
Evaluator_Draft4_Meta_1_No_Callback 405.8457499738585 ns/iter 434.2986496139125 ns/iter 0.93
Evaluator_Draft4_Required_Properties 1630.6911752544372 ns/iter 1669.7685797243366 ns/iter 0.98
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 38.11213751170276 ns/iter 40.08409129430936 ns/iter 0.95
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 31.662060411611964 ns/iter 32.30068587434573 ns/iter 0.98
Evaluator_Draft4_Items_Schema 561.6852341897485 ns/iter 570.0071994724879 ns/iter 0.99
Evaluator_Draft4_Nested_Object 3.483802520286557 ns/iter 4.923315846129513 ns/iter 0.71
Evaluator_Draft4_Properties_Triad_Optional 1200.0394758241334 ns/iter 1230.9381525669335 ns/iter 0.97
Evaluator_Draft4_Properties_Triad_Closed 981.1637896924508 ns/iter 1027.0307186518135 ns/iter 0.96
Evaluator_Draft4_Properties_Triad_Required 1233.4154622499298 ns/iter 1280.6752735745297 ns/iter 0.96
Evaluator_Draft4_Properties_Closed 185.19896216042378 ns/iter 193.81255396208445 ns/iter 0.96
Evaluator_Draft4_Non_Recursive_Ref 48.18460167557762 ns/iter 50.20074039999827 ns/iter 0.96
Evaluator_Draft4_Pattern_Properties_True 320.11370498551656 ns/iter 352.45780117834903 ns/iter 0.91
Evaluator_Draft4_Ref_To_Single_Property 37.541342779699264 ns/iter 37.5654020238899 ns/iter 1.00
Evaluator_Draft4_Additional_Properties_Type 102.44909120771206 ns/iter 105.05435236233076 ns/iter 0.98
Evaluator_Draft4_Nested_Oneof 109.52815836314622 ns/iter 115.72825590632523 ns/iter 0.95
Evaluator_Draft4_Long_Enum 19.30397712811837 ns/iter 20.53866346735104 ns/iter 0.94
Evaluator_Draft4_Type_Object 10.012471817837056 ns/iter 10.278035298206563 ns/iter 0.97
Compiler_2019_09_OMC_JSON_V2 11053591309.000011 ns/iter 11082028806.00004 ns/iter 1.00
Compiler_Draft6_AdaptiveCard 60501362374.999985 ns/iter 61591573382.00009 ns/iter 0.98

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (macos/gcc)

Benchmark suite Current: 8b4719e Previous: 430c029 Ratio
Compiler_Draft6_AdaptiveCard 40311984062.194824 ns/iter 54364140033.721924 ns/iter 0.74
Compiler_2019_09_OMC_JSON_V2 7766098737.716675 ns/iter 8870396137.237549 ns/iter 0.88
Evaluator_Draft4_Meta_1_No_Callback 247.186392206946 ns/iter 266.4119188798769 ns/iter 0.93
Evaluator_Draft4_Required_Properties 446.87965715872434 ns/iter 487.5774169473538 ns/iter 0.92
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 22.519275142855378 ns/iter 24.068791667784787 ns/iter 0.94
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 14.659954842808819 ns/iter 16.15909445163835 ns/iter 0.91
Evaluator_Draft4_Items_Schema 519.0040909755595 ns/iter 507.6666028200758 ns/iter 1.02
Evaluator_Draft4_Nested_Object 2.156593043587316 ns/iter 2.0729059588681396 ns/iter 1.04
Evaluator_Draft4_Properties_Triad_Optional 880.4864524650172 ns/iter 905.6410649001533 ns/iter 0.97
Evaluator_Draft4_Properties_Triad_Closed 799.0697269221782 ns/iter 860.6477021776054 ns/iter 0.93
Evaluator_Draft4_Properties_Triad_Required 878.1233456939558 ns/iter 946.3116460590899 ns/iter 0.93
Evaluator_Draft4_Properties_Closed 103.33032787156505 ns/iter 102.04775728664376 ns/iter 1.01
Evaluator_Draft4_Non_Recursive_Ref 21.629795567675586 ns/iter 20.84084675896433 ns/iter 1.04
Evaluator_Draft4_Pattern_Properties_True 265.1418779788502 ns/iter 249.71792572592406 ns/iter 1.06
Evaluator_Draft4_Ref_To_Single_Property 13.884640290873289 ns/iter 14.41816830592365 ns/iter 0.96
Evaluator_Draft4_Additional_Properties_Type 38.4106979306837 ns/iter 38.94957781429512 ns/iter 0.99
Evaluator_Draft4_Nested_Oneof 79.58294205937732 ns/iter 91.17882087797238 ns/iter 0.87
Evaluator_Draft4_Long_Enum 12.983646939781869 ns/iter 11.962886003070436 ns/iter 1.09
Evaluator_Draft4_Type_Object 6.277115796591391 ns/iter 6.572385448934159 ns/iter 0.96
Evaluator_Draft6_Property_Names 193.21950101064792 ns/iter 170.94411785940196 ns/iter 1.13
Evaluator_Draft7_If_Then_Else 38.68201469920484 ns/iter 32.47687534651633 ns/iter 1.19
Evaluator_Draft7_Vercel_1 79425.9256391383 ns/iter 106719.794965185 ns/iter 0.74
Evaluator_Draft7_Helm_Chart_Lock_1 366.9271411093488 ns/iter 514.6269798278809 ns/iter 0.71
Evaluator_2019_09_Unevaluated_Properties 154.493052862788 ns/iter 162.79445779743185 ns/iter 0.95
Evaluator_2019_09_OMC_JSON_V2_1 2535.9368122480864 ns/iter 2723.5027171131765 ns/iter 0.93
Evaluator_2020_12_Dynamic_Ref 624.5718324018037 ns/iter 637.3157269468857 ns/iter 0.98

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (windows/msvc)

Benchmark suite Current: 8b4719e Previous: 430c029 Ratio
Compiler_Draft6_AdaptiveCard 121851894900.00017 ns/iter 122306347899.99998 ns/iter 1.00
Compiler_2019_09_OMC_JSON_V2 25236217499.99984 ns/iter 25661686899.99995 ns/iter 0.98
Evaluator_Draft4_Meta_1_No_Callback 422.4212735924982 ns/iter 457.34795922946586 ns/iter 0.92
Evaluator_Draft4_Required_Properties 768.4447544641213 ns/iter 738.6259821428455 ns/iter 1.04
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 35.342826549050805 ns/iter 41.81964205353593 ns/iter 0.85
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 23.11287027775251 ns/iter 22.07233749999915 ns/iter 1.05
Evaluator_Draft4_Items_Schema 614.690267856994 ns/iter 624.7424107144184 ns/iter 0.98
Evaluator_Draft4_Nested_Object 4.030551346484219 ns/iter 4.059667864391761 ns/iter 0.99
Evaluator_Draft4_Properties_Triad_Optional 1693.1166563954132 ns/iter 1696.363127435733 ns/iter 1.00
Evaluator_Draft4_Properties_Triad_Closed 1401.4605357142987 ns/iter 1410.6963345102088 ns/iter 0.99
Evaluator_Draft4_Properties_Triad_Required 1710.9435194576592 ns/iter 1706.8177856130658 ns/iter 1.00
Evaluator_Draft4_Properties_Closed 148.40822551749886 ns/iter 144.34492659174833 ns/iter 1.03
Evaluator_Draft4_Non_Recursive_Ref 18.300179627680922 ns/iter 17.794829623169434 ns/iter 1.03
Evaluator_Draft4_Pattern_Properties_True 254.13982142863136 ns/iter 281.53082730044105 ns/iter 0.90
Evaluator_Draft4_Ref_To_Single_Property 23.930796428576937 ns/iter 23.186527643011175 ns/iter 1.03
Evaluator_Draft4_Additional_Properties_Type 30.82282079410419 ns/iter 31.11902232142987 ns/iter 0.99
Evaluator_Draft4_Nested_Oneof 141.1917727146266 ns/iter 141.94570348456224 ns/iter 0.99
Evaluator_Draft4_Long_Enum 22.113162499998396 ns/iter 21.16454581916773 ns/iter 1.04
Evaluator_Draft4_Type_Object 8.38781696428624 ns/iter 9.660040135447387 ns/iter 0.87
Evaluator_Draft6_Property_Names 427.95289945688097 ns/iter 415.0542895064385 ns/iter 1.03
Evaluator_Draft7_If_Then_Else 51.31188000000293 ns/iter 50.97071428571504 ns/iter 1.01
Evaluator_Draft7_Vercel_1 120463.78571430492 ns/iter 120182.40257130611 ns/iter 1.00
Evaluator_Draft7_Helm_Chart_Lock_1 590.4687999998259 ns/iter 609.2493749999254 ns/iter 0.97
Evaluator_2019_09_Unevaluated_Properties 421.67306250007647 ns/iter 428.5749374999171 ns/iter 0.98
Evaluator_2019_09_OMC_JSON_V2_1 4428.629374999105 ns/iter 4524.743822945433 ns/iter 0.98
Evaluator_2020_12_Dynamic_Ref 1344.3352257432805 ns/iter 1364.3614221603436 ns/iter 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.