Skip to content

Commit

Permalink
Re-introduce a faster LoopItems instruction (#218)
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 22, 2024
1 parent 351920f commit d6aea03
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 30 deletions.
6 changes: 6 additions & 0 deletions src/compiler/compile_describe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,12 @@ struct DescribeVisitor {
return message.str();
}

auto operator()(const LoopItems &) const -> std::string {
assert(this->target.is_array());
return "Every item in the array value was expected to validate against the "
"given subschema";
}

auto operator()(const LoopItemsFrom &step) const -> std::string {
assert(this->target.is_array());
const auto &value{step_value(step)};
Expand Down
1 change: 1 addition & 0 deletions src/compiler/compile_json.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ struct StepVisitor {
HANDLE_STEP("loop", "properties-type-strict-evaluate-any",
LoopPropertiesTypeStrictAnyEvaluate)
HANDLE_STEP("loop", "keys", LoopKeys)
HANDLE_STEP("loop", "items", LoopItems)
HANDLE_STEP("loop", "items-from", LoopItemsFrom)
HANDLE_STEP("loop", "items-unevaluated", LoopItemsUnevaluated)
HANDLE_STEP("loop", "items-type", LoopItemsType)
Expand Down
10 changes: 5 additions & 5 deletions src/compiler/default_compiler_draft4.h
Original file line number Diff line number Diff line change
Expand Up @@ -1229,9 +1229,9 @@ auto compiler_draft4_applicator_items_with_options(
Instructions children;

if (!subchildren.empty()) {
children.push_back(make<LoopItemsFrom>(
context, schema_context, dynamic_context, ValueUnsignedInteger{0},
std::move(subchildren)));
children.push_back(make<LoopItems>(context, schema_context,
dynamic_context, ValueNone{},
std::move(subchildren)));
}

if (!annotate && !track_evaluation) {
Expand Down Expand Up @@ -1288,8 +1288,8 @@ auto compiler_draft4_applicator_items_with_options(
}
}

return {make<LoopItemsFrom>(context, schema_context, dynamic_context,
ValueUnsignedInteger{0}, std::move(children))};
return {make<LoopItems>(context, schema_context, dynamic_context,
ValueNone{}, std::move(children))};
}

return compiler_draft4_applicator_items_array(
Expand Down
40 changes: 40 additions & 0 deletions src/evaluator/dispatch.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,46 @@ switch (static_cast<InstructionIndex>(instruction.index())) {
EVALUATE_END(loop, LoopKeys);
}

case IS_INSTRUCTION(LoopItems): {
EVALUATE_BEGIN(loop, LoopItems, target.is_array());
assert(!loop.children.empty());
result = true;

// To avoid index lookups and unnecessary conditionals
#ifdef SOURCEMETA_EVALUATOR_FAST
for (const auto &new_instance : target.as_array()) {
for (const auto &child : loop.children) {
if (!EVALUATE_RECURSE(child, new_instance)) {
result = false;
EVALUATE_END(loop, LoopItemsFrom);
}
}
}
#else
for (std::size_t index = 0; index < target.size(); index++) {
if (track) {
context.instance_location.push_back(index);
}
const auto &new_instance{target.at(index)};
for (const auto &child : loop.children) {
if (!EVALUATE_RECURSE(child, new_instance)) {
result = false;
if (track) {
context.instance_location.pop_back();
}
EVALUATE_END(loop, LoopItemsFrom);
}
}

if (track) {
context.instance_location.pop_back();
}
}
#endif

EVALUATE_END(loop, LoopItems);
}

case IS_INSTRUCTION(LoopItemsFrom): {
EVALUATE_BEGIN(loop, LoopItemsFrom,
target.is_array() && loop.value < target.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct LoopPropertiesTypeStrictEvaluate;
struct LoopPropertiesTypeStrictAny;
struct LoopPropertiesTypeStrictAnyEvaluate;
struct LoopKeys;
struct LoopItems;
struct LoopItemsFrom;
struct LoopItemsUnevaluated;
struct LoopItemsType;
Expand Down Expand Up @@ -119,7 +120,7 @@ using Instruction = std::variant<
LoopPropertiesStartsWith, LoopPropertiesExcept, LoopPropertiesWhitelist,
LoopPropertiesType, LoopPropertiesTypeEvaluate, LoopPropertiesTypeStrict,
LoopPropertiesTypeStrictEvaluate, LoopPropertiesTypeStrictAny,
LoopPropertiesTypeStrictAnyEvaluate, LoopKeys, LoopItemsFrom,
LoopPropertiesTypeStrictAnyEvaluate, LoopKeys, LoopItems, LoopItemsFrom,
LoopItemsUnevaluated, LoopItemsType, LoopItemsTypeStrict,
LoopItemsTypeStrictAny, LoopContains, ControlGroup, ControlGroupWhenDefines,
ControlLabel, ControlMark, ControlEvaluate, ControlJump,
Expand Down Expand Up @@ -194,6 +195,7 @@ enum class InstructionIndex : std::uint8_t {
LoopPropertiesTypeStrictAny,
LoopPropertiesTypeStrictAnyEvaluate,
LoopKeys,
LoopItems,
LoopItemsFrom,
LoopItemsUnevaluated,
LoopItemsType,
Expand Down Expand Up @@ -558,6 +560,10 @@ DEFINE_STEP_WITH_VALUE(Loop, PropertiesTypeStrictAnyEvaluate, ValueTypes)
/// @brief Represents a compiler step that loops over object property keys
DEFINE_STEP_APPLICATOR(Loop, Keys, ValueNone)

/// @ingroup evaluator_instructions
/// @brief Represents a compiler step that loops over array items
DEFINE_STEP_APPLICATOR(Loop, Items, ValueNone)

/// @ingroup evaluator_instructions
/// @brief Represents a compiler step that loops over array items starting from
/// a given index
Expand Down
36 changes: 18 additions & 18 deletions test/evaluator/evaluator_2019_09_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1854,7 +1854,7 @@ TEST(Evaluator_2019_09, items_2_exhaustive) {
sourcemeta::jsontoolkit::parse("[ \"foo\", \"bar\", \"baz\" ]")};
EVALUATE_WITH_TRACE_EXHAUSTIVE_SUCCESS(schema, instance, 6);

EVALUATE_TRACE_PRE(0, LoopItemsFrom, "/items", "#/items", "");
EVALUATE_TRACE_PRE(0, LoopItems, "/items", "#/items", "");
EVALUATE_TRACE_PRE(1, AssertionTypeStrict, "/items/type", "#/items/type",
"/0");
EVALUATE_TRACE_PRE(2, AssertionTypeStrict, "/items/type", "#/items/type",
Expand All @@ -1870,7 +1870,7 @@ TEST(Evaluator_2019_09, items_2_exhaustive) {
"#/items/type", "/1");
EVALUATE_TRACE_POST_SUCCESS(2, AssertionTypeStrict, "/items/type",
"#/items/type", "/2");
EVALUATE_TRACE_POST_SUCCESS(3, LoopItemsFrom, "/items", "#/items", "");
EVALUATE_TRACE_POST_SUCCESS(3, LoopItems, "/items", "#/items", "");
EVALUATE_TRACE_POST_ANNOTATION(4, "/items", "#/items", "", true);
EVALUATE_TRACE_POST_SUCCESS(5, LogicalWhenType, "/items", "#/items", "");

Expand Down Expand Up @@ -1921,7 +1921,7 @@ TEST(Evaluator_2019_09, items_3_exhaustive) {
sourcemeta::jsontoolkit::parse("[ \"foo\", 5, \"baz\" ]")};
EVALUATE_WITH_TRACE_EXHAUSTIVE_FAILURE(schema, instance, 3);

EVALUATE_TRACE_PRE(0, LoopItemsFrom, "/items", "#/items", "");
EVALUATE_TRACE_PRE(0, LoopItems, "/items", "#/items", "");
EVALUATE_TRACE_PRE(1, AssertionTypeStrict, "/items/type", "#/items/type",
"/0");
EVALUATE_TRACE_PRE(2, AssertionTypeStrict, "/items/type", "#/items/type",
Expand All @@ -1931,7 +1931,7 @@ TEST(Evaluator_2019_09, items_3_exhaustive) {
"#/items/type", "/0");
EVALUATE_TRACE_POST_FAILURE(1, AssertionTypeStrict, "/items/type",
"#/items/type", "/1");
EVALUATE_TRACE_POST_FAILURE(2, LoopItemsFrom, "/items", "#/items", "");
EVALUATE_TRACE_POST_FAILURE(2, LoopItems, "/items", "#/items", "");

EVALUATE_TRACE_POST_DESCRIBE(instance, 0,
"The value was expected to be of type string");
Expand Down Expand Up @@ -2273,7 +2273,7 @@ TEST(Evaluator_2019_09, additionalItems_2_exhaustive) {
sourcemeta::jsontoolkit::parse("[ \"foo\", \"bar\", \"baz\" ]")};
EVALUATE_WITH_TRACE_EXHAUSTIVE_SUCCESS(schema, instance, 6);

EVALUATE_TRACE_PRE(0, LoopItemsFrom, "/items", "#/items", "");
EVALUATE_TRACE_PRE(0, LoopItems, "/items", "#/items", "");
EVALUATE_TRACE_PRE(1, AssertionTypeStrict, "/items/type", "#/items/type",
"/0");
EVALUATE_TRACE_PRE(2, AssertionTypeStrict, "/items/type", "#/items/type",
Expand All @@ -2289,7 +2289,7 @@ TEST(Evaluator_2019_09, additionalItems_2_exhaustive) {
"#/items/type", "/1");
EVALUATE_TRACE_POST_SUCCESS(2, AssertionTypeStrict, "/items/type",
"#/items/type", "/2");
EVALUATE_TRACE_POST_SUCCESS(3, LoopItemsFrom, "/items", "#/items", "");
EVALUATE_TRACE_POST_SUCCESS(3, LoopItems, "/items", "#/items", "");
EVALUATE_TRACE_POST_ANNOTATION(4, "/items", "#/items", "", true);
EVALUATE_TRACE_POST_SUCCESS(5, LogicalWhenType, "/items", "#/items", "");

Expand Down Expand Up @@ -3861,15 +3861,15 @@ TEST(Evaluator_2019_09, unevaluatedItems_3_exhaustive) {

EVALUATE_WITH_TRACE_EXHAUSTIVE_SUCCESS(schema, instance, 4);

EVALUATE_TRACE_PRE(0, LoopItemsFrom, "/items", "#/items", "");
EVALUATE_TRACE_PRE(0, LoopItems, "/items", "#/items", "");
EVALUATE_TRACE_PRE(1, AssertionTypeStrict, "/items/type", "#/items/type",
"/0");
EVALUATE_TRACE_PRE(2, LogicalWhenType, "/items", "#/items", "");
EVALUATE_TRACE_PRE_ANNOTATION(3, "/items", "#/items", "");

EVALUATE_TRACE_POST_SUCCESS(0, AssertionTypeStrict, "/items/type",
"#/items/type", "/0");
EVALUATE_TRACE_POST_SUCCESS(1, LoopItemsFrom, "/items", "#/items", "");
EVALUATE_TRACE_POST_SUCCESS(1, LoopItems, "/items", "#/items", "");
EVALUATE_TRACE_POST_ANNOTATION(2, "/items", "#/items", "", true);
EVALUATE_TRACE_POST_SUCCESS(3, LogicalWhenType, "/items", "#/items", "");

Expand Down Expand Up @@ -4595,7 +4595,7 @@ TEST(Evaluator_2019_09, unevaluatedItems_11) {
EVALUATE_WITH_TRACE_FAST_FAILURE(schema, instance, 6);

EVALUATE_TRACE_PRE(0, LogicalOr, "/anyOf", "#/anyOf", "");
EVALUATE_TRACE_PRE(1, LoopItemsFrom, "/anyOf/0/items", "#/anyOf/0/items", "");
EVALUATE_TRACE_PRE(1, LoopItems, "/anyOf/0/items", "#/anyOf/0/items", "");
EVALUATE_TRACE_PRE(2, AssertionTypeStrict, "/anyOf/0/items/type",
"#/anyOf/0/items/type", "/0");
EVALUATE_TRACE_PRE(3, AssertionTypeStrict, "/anyOf/0/items/type",
Expand All @@ -4609,8 +4609,8 @@ TEST(Evaluator_2019_09, unevaluatedItems_11) {
"#/anyOf/0/items/type", "/0");
EVALUATE_TRACE_POST_FAILURE(1, AssertionTypeStrict, "/anyOf/0/items/type",
"#/anyOf/0/items/type", "/1");
EVALUATE_TRACE_POST_FAILURE(2, LoopItemsFrom, "/anyOf/0/items",
"#/anyOf/0/items", "");
EVALUATE_TRACE_POST_FAILURE(2, LoopItems, "/anyOf/0/items", "#/anyOf/0/items",
"");
EVALUATE_TRACE_POST_SUCCESS(3, LogicalOr, "/anyOf", "#/anyOf", "");
EVALUATE_TRACE_POST_FAILURE(4, AssertionFail, "/unevaluatedItems",
"#/unevaluatedItems", "/0");
Expand Down Expand Up @@ -4655,7 +4655,7 @@ TEST(Evaluator_2019_09, unevaluatedItems_11_exhaustive) {
EVALUATE_WITH_TRACE_EXHAUSTIVE_FAILURE(schema, instance, 6);

EVALUATE_TRACE_PRE(0, LogicalOr, "/anyOf", "#/anyOf", "");
EVALUATE_TRACE_PRE(1, LoopItemsFrom, "/anyOf/0/items", "#/anyOf/0/items", "");
EVALUATE_TRACE_PRE(1, LoopItems, "/anyOf/0/items", "#/anyOf/0/items", "");
EVALUATE_TRACE_PRE(2, AssertionTypeStrict, "/anyOf/0/items/type",
"#/anyOf/0/items/type", "/0");
EVALUATE_TRACE_PRE(3, AssertionTypeStrict, "/anyOf/0/items/type",
Expand All @@ -4669,8 +4669,8 @@ TEST(Evaluator_2019_09, unevaluatedItems_11_exhaustive) {
"#/anyOf/0/items/type", "/0");
EVALUATE_TRACE_POST_FAILURE(1, AssertionTypeStrict, "/anyOf/0/items/type",
"#/anyOf/0/items/type", "/1");
EVALUATE_TRACE_POST_FAILURE(2, LoopItemsFrom, "/anyOf/0/items",
"#/anyOf/0/items", "");
EVALUATE_TRACE_POST_FAILURE(2, LoopItems, "/anyOf/0/items", "#/anyOf/0/items",
"");
EVALUATE_TRACE_POST_SUCCESS(3, LogicalOr, "/anyOf", "#/anyOf", "");
EVALUATE_TRACE_POST_FAILURE(4, AssertionFail, "/unevaluatedItems",
"#/unevaluatedItems", "/0");
Expand Down Expand Up @@ -5205,7 +5205,7 @@ TEST(Evaluator_2019_09, recursiveRef_5) {
EVALUATE_WITH_TRACE_FAST_SUCCESS(schema, instance, 4);

EVALUATE_TRACE_PRE(0, ControlMark, "", "https://example.com/nested", "");
EVALUATE_TRACE_PRE(1, LoopItemsFrom, "/items",
EVALUATE_TRACE_PRE(1, LoopItems, "/items",
"https://example.com/schema#/items", "");
EVALUATE_TRACE_PRE(2, AssertionArrayPrefix, "/items/items",
"https://example.com/nested#/items", "/0");
Expand All @@ -5220,7 +5220,7 @@ TEST(Evaluator_2019_09, recursiveRef_5) {
"https://example.com/nested#/items/0/$recursiveRef", "/0/0");
EVALUATE_TRACE_POST_SUCCESS(2, AssertionArrayPrefix, "/items/items",
"https://example.com/nested#/items", "/0");
EVALUATE_TRACE_POST_SUCCESS(3, LoopItemsFrom, "/items",
EVALUATE_TRACE_POST_SUCCESS(3, LoopItems, "/items",
"https://example.com/schema#/items", "");

EVALUATE_TRACE_POST_DESCRIBE(instance, 0,
Expand Down Expand Up @@ -5259,7 +5259,7 @@ TEST(Evaluator_2019_09, recursiveRef_5_exhaustive) {
EVALUATE_WITH_TRACE_EXHAUSTIVE_SUCCESS(schema, instance, 8);

EVALUATE_TRACE_PRE(0, ControlMark, "", "https://example.com/nested", "");
EVALUATE_TRACE_PRE(1, LoopItemsFrom, "/items",
EVALUATE_TRACE_PRE(1, LoopItems, "/items",
"https://example.com/schema#/items", "");
EVALUATE_TRACE_PRE(2, AssertionArrayPrefix, "/items/items",
"https://example.com/nested#/items", "/0");
Expand All @@ -5286,7 +5286,7 @@ TEST(Evaluator_2019_09, recursiveRef_5_exhaustive) {
3, "/items/items", "https://example.com/nested#/items", "/0", true);
EVALUATE_TRACE_POST_SUCCESS(4, AssertionArrayPrefix, "/items/items",
"https://example.com/nested#/items", "/0");
EVALUATE_TRACE_POST_SUCCESS(5, LoopItemsFrom, "/items",
EVALUATE_TRACE_POST_SUCCESS(5, LoopItems, "/items",
"https://example.com/schema#/items", "");
EVALUATE_TRACE_POST_ANNOTATION(6, "/items",
"https://example.com/schema#/items", "", true);
Expand Down
12 changes: 6 additions & 6 deletions test/evaluator/evaluator_draft4_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ TEST(Evaluator_draft4, properties_11) {
EVALUATE_TRACE_PRE(1, AssertionTypeStrict, "/properties/bar/type",
"#/properties/bar/type", "/bar");

EVALUATE_TRACE_PRE(2, LoopItemsFrom, "/properties/foo/items",
EVALUATE_TRACE_PRE(2, LoopItems, "/properties/foo/items",
"#/properties/foo/items", "/foo");
EVALUATE_TRACE_PRE(3, AssertionLessEqual, "/properties/foo/items/maximum",
"#/properties/foo/items/maximum", "/foo/0");
Expand All @@ -1275,7 +1275,7 @@ TEST(Evaluator_draft4, properties_11) {
EVALUATE_TRACE_POST_SUCCESS(4, AssertionTypeStrictAny,
"/properties/foo/items/type",
"#/properties/foo/items/type", "/foo/0");
EVALUATE_TRACE_POST_SUCCESS(5, LoopItemsFrom, "/properties/foo/items",
EVALUATE_TRACE_POST_SUCCESS(5, LoopItems, "/properties/foo/items",
"#/properties/foo/items", "/foo");

EVALUATE_TRACE_POST_DESCRIBE(instance, 0,
Expand Down Expand Up @@ -2971,7 +2971,7 @@ TEST(Evaluator_draft4, items_2_exhaustive) {
sourcemeta::jsontoolkit::parse("[ \"foo\", \"bar\", \"baz\" ]")};
EVALUATE_WITH_TRACE_EXHAUSTIVE_SUCCESS(schema, instance, 4);

EVALUATE_TRACE_PRE(0, LoopItemsFrom, "/items", "#/items", "");
EVALUATE_TRACE_PRE(0, LoopItems, "/items", "#/items", "");
EVALUATE_TRACE_PRE(1, AssertionTypeStrict, "/items/type", "#/items/type",
"/0");
EVALUATE_TRACE_PRE(2, AssertionTypeStrict, "/items/type", "#/items/type",
Expand All @@ -2985,7 +2985,7 @@ TEST(Evaluator_draft4, items_2_exhaustive) {
"#/items/type", "/1");
EVALUATE_TRACE_POST_SUCCESS(2, AssertionTypeStrict, "/items/type",
"#/items/type", "/2");
EVALUATE_TRACE_POST_SUCCESS(3, LoopItemsFrom, "/items", "#/items", "");
EVALUATE_TRACE_POST_SUCCESS(3, LoopItems, "/items", "#/items", "");

EVALUATE_TRACE_POST_DESCRIBE(instance, 0,
"The value was expected to be of type string");
Expand Down Expand Up @@ -3199,7 +3199,7 @@ TEST(Evaluator_draft4, items_10) {

EVALUATE_WITH_TRACE_FAST_FAILURE(schema, instance, 2);

EVALUATE_TRACE_PRE(0, LoopItemsFrom, "/properties/features/items",
EVALUATE_TRACE_PRE(0, LoopItems, "/properties/features/items",
"#/properties/features/items", "/features");
EVALUATE_TRACE_PRE(1, AssertionTypeStrict,
"/properties/features/items/properties/geometry/type",
Expand All @@ -3211,7 +3211,7 @@ TEST(Evaluator_draft4, items_10) {
"/properties/features/items/properties/geometry/type",
"#/properties/features/items/properties/geometry/type",
"/features/0/geometry");
EVALUATE_TRACE_POST_FAILURE(1, LoopItemsFrom, "/properties/features/items",
EVALUATE_TRACE_POST_FAILURE(1, LoopItems, "/properties/features/items",
"#/properties/features/items", "/features");

EVALUATE_TRACE_POST_DESCRIBE(
Expand Down

5 comments on commit d6aea03

@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: d6aea03 Previous: 351920f Ratio
Compiler_Draft6_AdaptiveCard 33869077958.999924 ns/iter 32371868500.000004 ns/iter 1.05
Compiler_2019_09_OMC_JSON_V2 6893266458.99996 ns/iter 7010034667.000013 ns/iter 0.98
Evaluator_Draft4_Meta_1_No_Callback 266.40316116308855 ns/iter 256.3379369079197 ns/iter 1.04
Evaluator_Draft4_Required_Properties 337.65030726711564 ns/iter 339.41037806598865 ns/iter 0.99
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 20.457076963231675 ns/iter 20.963272856703544 ns/iter 0.98
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 10.483426542326681 ns/iter 10.33756230146335 ns/iter 1.01
Evaluator_Draft4_Items_Schema 347.64746910374345 ns/iter 524.4800051060521 ns/iter 0.66
Evaluator_Draft4_Nested_Object 3.0133256788435414 ns/iter 3.053990288781511 ns/iter 0.99
Evaluator_Draft4_Properties_Triad_Optional 991.6583600440894 ns/iter 1033.5932360493698 ns/iter 0.96
Evaluator_Draft4_Properties_Triad_Closed 701.6918274638583 ns/iter 689.1956247686363 ns/iter 1.02
Evaluator_Draft4_Properties_Triad_Required 976.9737431708752 ns/iter 992.3540822548066 ns/iter 0.98
Evaluator_Draft4_Properties_Closed 83.63887673495408 ns/iter 78.64556513416193 ns/iter 1.06
Evaluator_Draft4_Non_Recursive_Ref 12.258270716103311 ns/iter 11.248897333105095 ns/iter 1.09
Evaluator_Draft4_Pattern_Properties_True 1196.663927935761 ns/iter 1153.0573476238887 ns/iter 1.04
Evaluator_Draft4_Ref_To_Single_Property 11.87445820660855 ns/iter 11.108759150218766 ns/iter 1.07
Evaluator_Draft4_Additional_Properties_Type 26.480663383939103 ns/iter 25.589226780679624 ns/iter 1.03
Evaluator_Draft4_Nested_Oneof 70.98830290277623 ns/iter 69.7717052900564 ns/iter 1.02
Evaluator_Draft4_Long_Enum 30.72684585537686 ns/iter 29.121188046368793 ns/iter 1.06
Evaluator_Draft4_Type_Object 6.37519875182017 ns/iter 6.338763723215878 ns/iter 1.01
Evaluator_Draft6_Property_Names 257.74715057130607 ns/iter 250.4676580790255 ns/iter 1.03
Evaluator_Draft7_If_Then_Else 29.096329076018588 ns/iter 28.05853545442551 ns/iter 1.04
Evaluator_Draft7_Vercel_1 102135.18707186017 ns/iter 94922.93039538481 ns/iter 1.08
Evaluator_2019_09_Unevaluated_Properties 170.68889269150628 ns/iter 161.6922150440839 ns/iter 1.06
Evaluator_2019_09_OMC_JSON_V2_1 6280.866148292133 ns/iter 5956.391282513435 ns/iter 1.05
Evaluator_2020_12_Dynamic_Ref 568.2713481464624 ns/iter 528.0956155727199 ns/iter 1.08

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: d6aea03 Previous: 351920f Ratio
Compiler_Draft6_AdaptiveCard 58893088289.000046 ns/iter 57876894523.99996 ns/iter 1.02
Compiler_2019_09_OMC_JSON_V2 11195867361.999945 ns/iter 11106052109.000017 ns/iter 1.01
Evaluator_Draft4_Meta_1_No_Callback 361.9677162174206 ns/iter 355.96484778863197 ns/iter 1.02
Evaluator_Draft4_Required_Properties 766.6552314593915 ns/iter 734.5598405678757 ns/iter 1.04
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 40.30960661873921 ns/iter 37.749948992883944 ns/iter 1.07
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 23.523185371483923 ns/iter 22.912928830076467 ns/iter 1.03
Evaluator_Draft4_Items_Schema 758.0379596280372 ns/iter 1038.7256872166943 ns/iter 0.73
Evaluator_Draft4_Nested_Object 4.9504171767395055 ns/iter 4.3313366516312115 ns/iter 1.14
Evaluator_Draft4_Properties_Triad_Optional 1246.5781734599136 ns/iter 1229.2010565732191 ns/iter 1.01
Evaluator_Draft4_Properties_Triad_Closed 974.9353048671987 ns/iter 948.9072186472238 ns/iter 1.03
Evaluator_Draft4_Properties_Triad_Required 1283.020744959124 ns/iter 1274.091914104856 ns/iter 1.01
Evaluator_Draft4_Properties_Closed 141.52355147525572 ns/iter 133.95973714802255 ns/iter 1.06
Evaluator_Draft4_Non_Recursive_Ref 30.007971356071316 ns/iter 30.358493182237886 ns/iter 0.99
Evaluator_Draft4_Pattern_Properties_True 1902.4718212369528 ns/iter 1928.5216070493532 ns/iter 0.99
Evaluator_Draft4_Ref_To_Single_Property 24.598298758373307 ns/iter 22.904151431379788 ns/iter 1.07
Evaluator_Draft4_Additional_Properties_Type 54.259794200293356 ns/iter 53.51238254224642 ns/iter 1.01
Evaluator_Draft4_Nested_Oneof 138.39530548982674 ns/iter 128.0015285532819 ns/iter 1.08
Evaluator_Draft4_Long_Enum 23.221803262944125 ns/iter 21.969333659009536 ns/iter 1.06
Evaluator_Draft4_Type_Object 12.375304491955866 ns/iter 11.130041145073092 ns/iter 1.11
Evaluator_Draft6_Property_Names 466.4936170666491 ns/iter 469.36456887432314 ns/iter 0.99
Evaluator_Draft7_If_Then_Else 58.733582352516514 ns/iter 56.29640779677361 ns/iter 1.04
Evaluator_Draft7_Vercel_1 115829.96717610193 ns/iter 120706.5770458808 ns/iter 0.96
Evaluator_2019_09_Unevaluated_Properties 200.16455642522655 ns/iter 204.21134114812224 ns/iter 0.98
Evaluator_2019_09_OMC_JSON_V2_1 8647.617590345804 ns/iter 8544.129691229216 ns/iter 1.01
Evaluator_2020_12_Dynamic_Ref 868.2653890025888 ns/iter 862.7108346878377 ns/iter 1.01

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: d6aea03 Previous: 351920f Ratio
Compiler_Draft6_AdaptiveCard 43370833873.74878 ns/iter 45701021909.713745 ns/iter 0.95
Compiler_2019_09_OMC_JSON_V2 8194782972.335815 ns/iter 8509001016.616821 ns/iter 0.96
Evaluator_Draft4_Meta_1_No_Callback 253.648569536704 ns/iter 264.28945732202675 ns/iter 0.96
Evaluator_Draft4_Required_Properties 440.973953295715 ns/iter 465.3571244895609 ns/iter 0.95
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 23.985162751524268 ns/iter 23.57821680228467 ns/iter 1.02
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 13.433983368046526 ns/iter 14.299650277554058 ns/iter 0.94
Evaluator_Draft4_Items_Schema 515.9943533737711 ns/iter 690.5117621134142 ns/iter 0.75
Evaluator_Draft4_Nested_Object 1.9861854115403037 ns/iter 2.0187358143258223 ns/iter 0.98
Evaluator_Draft4_Properties_Triad_Optional 1068.0669437436925 ns/iter 1070.0710760349077 ns/iter 1.00
Evaluator_Draft4_Properties_Triad_Closed 839.2309391283948 ns/iter 849.0893052161464 ns/iter 0.99
Evaluator_Draft4_Properties_Triad_Required 1052.0462207465412 ns/iter 1059.4036352156966 ns/iter 0.99
Evaluator_Draft4_Properties_Closed 96.72706989614377 ns/iter 97.55012049395523 ns/iter 0.99
Evaluator_Draft4_Non_Recursive_Ref 18.87851455151047 ns/iter 19.875150471952388 ns/iter 0.95
Evaluator_Draft4_Pattern_Properties_True 1632.8889591506124 ns/iter 1671.5057676738504 ns/iter 0.98
Evaluator_Draft4_Ref_To_Single_Property 12.694319412727875 ns/iter 13.24434392378638 ns/iter 0.96
Evaluator_Draft4_Additional_Properties_Type 37.63557732053503 ns/iter 45.001936567579804 ns/iter 0.84
Evaluator_Draft4_Nested_Oneof 80.93208739516467 ns/iter 103.16027359492428 ns/iter 0.78
Evaluator_Draft4_Long_Enum 10.713009032857563 ns/iter 12.798838858974372 ns/iter 0.84
Evaluator_Draft4_Type_Object 6.173911860943417 ns/iter 6.3421487216778685 ns/iter 0.97
Evaluator_Draft6_Property_Names 351.3940163015555 ns/iter 415.4755781919503 ns/iter 0.85
Evaluator_Draft7_If_Then_Else 31.33725347025839 ns/iter 42.48673344164721 ns/iter 0.74
Evaluator_Draft7_Vercel_1 90356.50419775175 ns/iter 117747.09390610764 ns/iter 0.77
Evaluator_2019_09_Unevaluated_Properties 160.2965547555714 ns/iter 213.39953282165484 ns/iter 0.75
Evaluator_2019_09_OMC_JSON_V2_1 5698.569860845759 ns/iter 6303.751006533201 ns/iter 0.90
Evaluator_2020_12_Dynamic_Ref 593.8471607607722 ns/iter 573.7167832047095 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: d6aea03 Previous: 351920f Ratio
Evaluator_2020_12_Dynamic_Ref 845.3444419667239 ns/iter 860.9754548976923 ns/iter 0.98
Evaluator_2019_09_Unevaluated_Properties 268.72120235295534 ns/iter 269.6817975792568 ns/iter 1.00
Evaluator_2019_09_OMC_JSON_V2_1 11142.97419045907 ns/iter 11389.127172595463 ns/iter 0.98
Evaluator_Draft7_If_Then_Else 50.607249387272645 ns/iter 51.99399021581725 ns/iter 0.97
Evaluator_Draft7_Vercel_1 129519.9979059654 ns/iter 142260.56989461146 ns/iter 0.91
Evaluator_Draft6_Property_Names 1156.1136129339777 ns/iter 1154.949756651416 ns/iter 1.00
Evaluator_Draft4_Meta_1_No_Callback 435.291148409125 ns/iter 413.13674744685954 ns/iter 1.05
Evaluator_Draft4_Required_Properties 1761.8012973321054 ns/iter 1701.6717437460045 ns/iter 1.04
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 40.83235649825776 ns/iter 37.21850363514737 ns/iter 1.10
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 34.23012864308106 ns/iter 32.195143023058336 ns/iter 1.06
Evaluator_Draft4_Items_Schema 582.7814701130959 ns/iter 904.3123356447452 ns/iter 0.64
Evaluator_Draft4_Nested_Object 3.788085042816423 ns/iter 3.4836189958076638 ns/iter 1.09
Evaluator_Draft4_Properties_Triad_Optional 1355.7292977413808 ns/iter 1306.6416149124532 ns/iter 1.04
Evaluator_Draft4_Properties_Triad_Closed 1070.855547879727 ns/iter 1027.9459068952988 ns/iter 1.04
Evaluator_Draft4_Properties_Triad_Required 1399.7997985791112 ns/iter 1348.548059950198 ns/iter 1.04
Evaluator_Draft4_Properties_Closed 188.45298723391895 ns/iter 196.31645949837312 ns/iter 0.96
Evaluator_Draft4_Non_Recursive_Ref 49.8452510795477 ns/iter 48.29771109087109 ns/iter 1.03
Evaluator_Draft4_Pattern_Properties_True 2058.779947544089 ns/iter 2065.6447248269956 ns/iter 1.00
Evaluator_Draft4_Ref_To_Single_Property 38.33232538408909 ns/iter 36.537270337243655 ns/iter 1.05
Evaluator_Draft4_Additional_Properties_Type 103.91156577874136 ns/iter 102.64828036792204 ns/iter 1.01
Evaluator_Draft4_Nested_Oneof 119.36425023248025 ns/iter 107.6921090453851 ns/iter 1.11
Evaluator_Draft4_Long_Enum 22.12074829247047 ns/iter 19.63349135114521 ns/iter 1.13
Evaluator_Draft4_Type_Object 10.630988164215294 ns/iter 10.015738233858494 ns/iter 1.06
Compiler_2019_09_OMC_JSON_V2 11470979284.999998 ns/iter 11463723896.000032 ns/iter 1.00
Compiler_Draft6_AdaptiveCard 66691768967.00003 ns/iter 68550739452.000015 ns/iter 0.97

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: d6aea03 Previous: 351920f Ratio
Compiler_Draft6_AdaptiveCard 118384340900.00009 ns/iter 118571526399.99992 ns/iter 1.00
Compiler_2019_09_OMC_JSON_V2 25912099399.99999 ns/iter 25598983800.000042 ns/iter 1.01
Evaluator_Draft4_Meta_1_No_Callback 446.5548268155685 ns/iter 439.9823750000564 ns/iter 1.01
Evaluator_Draft4_Required_Properties 720.3409598215416 ns/iter 755.6485491070829 ns/iter 0.95
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 36.9550446428565 ns/iter 35.540559806649235 ns/iter 1.04
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 22.170424999998772 ns/iter 22.299621874999787 ns/iter 0.99
Evaluator_Draft4_Items_Schema 616.7301785714991 ns/iter 853.1087053569307 ns/iter 0.72
Evaluator_Draft4_Nested_Object 4.1467017038336556 ns/iter 4.040223578643813 ns/iter 1.03
Evaluator_Draft4_Properties_Triad_Optional 4255.341537794064 ns/iter 4305.830309897123 ns/iter 0.99
Evaluator_Draft4_Properties_Triad_Closed 3510.9784124610787 ns/iter 3437.8376122096874 ns/iter 1.02
Evaluator_Draft4_Properties_Triad_Required 4297.066343869334 ns/iter 4326.8499999996375 ns/iter 0.99
Evaluator_Draft4_Properties_Closed 142.34110078833208 ns/iter 141.55956734108585 ns/iter 1.01
Evaluator_Draft4_Non_Recursive_Ref 15.280386160715207 ns/iter 15.495551339285946 ns/iter 0.99
Evaluator_Draft4_Pattern_Properties_True 8801.566957289457 ns/iter 7008.820312499609 ns/iter 1.26
Evaluator_Draft4_Ref_To_Single_Property 23.09612585830569 ns/iter 29.297864601345257 ns/iter 0.79
Evaluator_Draft4_Additional_Properties_Type 29.617900239561283 ns/iter 29.490621442934273 ns/iter 1.00
Evaluator_Draft4_Nested_Oneof 145.35180154681441 ns/iter 137.05221486378284 ns/iter 1.06
Evaluator_Draft4_Long_Enum 21.64194687500043 ns/iter 20.49739915844135 ns/iter 1.06
Evaluator_Draft4_Type_Object 9.622400849900545 ns/iter 9.610120312498083 ns/iter 1.00
Evaluator_Draft6_Property_Names 553.207200000088 ns/iter 549.9600000000555 ns/iter 1.01
Evaluator_Draft7_If_Then_Else 51.649187499996124 ns/iter 49.34329999998681 ns/iter 1.05
Evaluator_Draft7_Vercel_1 134478.98754519786 ns/iter 135984.8533547354 ns/iter 0.99
Evaluator_2019_09_Unevaluated_Properties 436.3473125000894 ns/iter 446.207749999985 ns/iter 0.98
Evaluator_2019_09_OMC_JSON_V2_1 9845.017209744972 ns/iter 9851.879679108068 ns/iter 1.00
Evaluator_2020_12_Dynamic_Ref 1416.2281177554162 ns/iter 1382.44337837369 ns/iter 1.02

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

Please sign in to comment.