Skip to content

Commit

Permalink
Add a Negation token type to PointerTemplate (#1571)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti authored Feb 12, 2025
1 parent 78f9c0a commit c41b28a
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ template <typename PointerT> class GenericPointerTemplate {
auto operator==(const Condition &) const noexcept -> bool = default;
auto operator<(const Condition &) const noexcept -> bool { return false; }
};
struct Negation {
auto operator==(const Negation &) const noexcept -> bool = default;
auto operator<(const Negation &) const noexcept -> bool { return false; }
};
using Regex = typename PointerT::Value::String;
using Token = typename PointerT::Token;
using Container =
std::vector<std::variant<Wildcard, Condition, Regex, Token>>;
std::vector<std::variant<Wildcard, Condition, Negation, Regex, Token>>;

/// This constructor creates an empty JSON Pointer template. For example:
///
Expand Down
5 changes: 5 additions & 0 deletions src/core/jsonpointer/stringify.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@ auto stringify(const PointerT &pointer,
stream.put(internal::token_pointer_tilde<CharT>);
stream.put('?');
stream.put(internal::token_pointer_tilde<CharT>);
} else if (std::holds_alternative<typename PointerT::Negation>(token)) {
stream.put(internal::token_pointer_slash<CharT>);
stream.put(internal::token_pointer_tilde<CharT>);
stream.put('!');
stream.put(internal::token_pointer_tilde<CharT>);
} else {
stringify_token<CharT, Traits, Allocator, typename PointerT::Token>(
std::get<typename PointerT::Token>(token), stream,
Expand Down
17 changes: 12 additions & 5 deletions src/core/jsonschema/walker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ auto walk(const std::optional<sourcemeta::core::Pointer> &parent,
case sourcemeta::core::SchemaKeywordType::ApplicatorValueInPlaceNegate: {
sourcemeta::core::Pointer new_pointer{pointer};
new_pointer.emplace_back(pair.first);
walk(pointer, new_pointer, instance_location, {}, subschemas,
auto new_instance_location{instance_location};
new_instance_location.emplace_back(
sourcemeta::core::PointerTemplate::Negation{});
walk(pointer, new_pointer, new_instance_location,
{sourcemeta::core::PointerTemplate::Negation{}}, subschemas,
pair.second, walker, resolver, new_dialect, type, level + 1,
orphan);
} break;
Expand Down Expand Up @@ -204,11 +208,14 @@ auto walk(const std::optional<sourcemeta::core::Pointer> &parent,
new_pointer.emplace_back(index);
auto new_instance_location{instance_location};
new_instance_location.emplace_back(
sourcemeta::core::PointerTemplate::Conditional{});
sourcemeta::core::PointerTemplate::Condition{});
new_instance_location.emplace_back(
sourcemeta::core::PointerTemplate::Negation{});
walk(pointer, new_pointer, new_instance_location,
{sourcemeta::core::PointerTemplate::Conditional{}}, subschemas,
pair.second.at(index), walker, resolver, new_dialect, type,
level + 1, orphan);
{sourcemeta::core::PointerTemplate::Condition{},
sourcemeta::core::PointerTemplate::Negation{}},
subschemas, pair.second.at(index), walker, resolver,
new_dialect, type, level + 1, orphan);
}
}

Expand Down
42 changes: 42 additions & 0 deletions test/jsonpointer/jsonpointer_template_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,36 @@ TEST(JSONPointer_template, equality_with_condition_wildcard_false) {
EXPECT_NE(left, right);
}

TEST(JSONPointer_template, equality_with_negation_wildcard_true) {
const sourcemeta::core::Pointer prefix{"foo", "bar"};
const sourcemeta::core::Pointer suffix{"baz"};

sourcemeta::core::PointerTemplate left{prefix};
left.emplace_back(sourcemeta::core::PointerTemplate::Negation{});
left.push_back(suffix);

sourcemeta::core::PointerTemplate right{prefix};
right.emplace_back(sourcemeta::core::PointerTemplate::Negation{});
right.push_back(suffix);

EXPECT_EQ(left, right);
}

TEST(JSONPointer_template, equality_with_negation_wildcard_false) {
const sourcemeta::core::Pointer prefix{"foo", "bar"};
const sourcemeta::core::Pointer suffix{"baz"};

sourcemeta::core::PointerTemplate left{prefix};
left.emplace_back(sourcemeta::core::PointerTemplate::Negation{});
left.push_back(suffix);

sourcemeta::core::PointerTemplate right{prefix};
right.push_back(suffix);
right.emplace_back(sourcemeta::core::PointerTemplate::Negation{});

EXPECT_NE(left, right);
}

TEST(JSONPointer_template, pop_back) {
const sourcemeta::core::Pointer base{"foo", "bar"};
sourcemeta::core::PointerTemplate pointer{base};
Expand Down Expand Up @@ -244,6 +274,18 @@ TEST(JSONPointer_template, stringify_condition) {
EXPECT_EQ(stream.str(), "/foo/bar/~?~");
}

TEST(JSONPointer_template, stringify_negation) {
const sourcemeta::core::Pointer prefix{"foo", "bar"};

sourcemeta::core::PointerTemplate pointer{prefix};
pointer.emplace_back(sourcemeta::core::PointerTemplate::Negation{});

std::ostringstream stream;
sourcemeta::core::stringify(pointer, stream);

EXPECT_EQ(stream.str(), "/foo/bar/~!~");
}

TEST(JSONPointer_template, concat_move) {
const sourcemeta::core::Pointer pointer_left{"foo"};
const sourcemeta::core::Pointer pointer_right{"bar", "baz"};
Expand Down
2 changes: 1 addition & 1 deletion test/jsonschema/jsonschema_official_walker_2019_09_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ TEST(JSONSchema_official_walker_2019_09, instance_locations) {
EXPECT_OFFICIAL_WALKER_ENTRY_2019_09(entries, 5, "/if", "", "/~?~", "/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_2019_09(entries, 6, "/then", "", "/~?~", "/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_2019_09(entries, 7, "/else", "", "/~?~", "/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_2019_09(entries, 8, "/not", "", "", "");
EXPECT_OFFICIAL_WALKER_ENTRY_2019_09(entries, 8, "/not", "", "/~!~", "/~!~");

// Applicator vocabulary (object)
EXPECT_OFFICIAL_WALKER_ENTRY_2019_09(entries, 9, "/properties/foo", "",
Expand Down
2 changes: 1 addition & 1 deletion test/jsonschema/jsonschema_official_walker_2020_12_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ TEST(JSONSchema_official_walker_2020_12, instance_locations) {
EXPECT_OFFICIAL_WALKER_ENTRY_2020_12(entries, 5, "/if", "", "/~?~", "/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_2020_12(entries, 6, "/then", "", "/~?~", "/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_2020_12(entries, 7, "/else", "", "/~?~", "/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_2020_12(entries, 8, "/not", "", "", "");
EXPECT_OFFICIAL_WALKER_ENTRY_2020_12(entries, 8, "/not", "", "/~!~", "/~!~");

// Applicator vocabulary (object)
EXPECT_OFFICIAL_WALKER_ENTRY_2020_12(entries, 9, "/properties/foo", "",
Expand Down
8 changes: 4 additions & 4 deletions test/jsonschema/jsonschema_official_walker_draft3_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,10 @@ TEST(JSONSchema_official_walker_draft3, instance_locations) {
"/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT3(entries, 12, "/type/2", "", "/~?~",
"/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT3(entries, 13, "/disallow/1", "", "/~?~",
"/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT3(entries, 14, "/disallow/2", "", "/~?~",
"/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT3(entries, 13, "/disallow/1", "",
"/~?~/~!~", "/~?~/~!~");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT3(entries, 14, "/disallow/2", "",
"/~?~/~!~", "/~?~/~!~");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT3(entries, 15, "/extends", "", "", "");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT3(entries, 16, "/extends/extends/0",
"/extends", "", "");
Expand Down
2 changes: 1 addition & 1 deletion test/jsonschema/jsonschema_official_walker_draft4_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ TEST(JSONSchema_official_walker_draft4, instance_locations) {
"/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT4(entries, 4, "/oneOf/0", "", "/~?~",
"/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT4(entries, 5, "/not", "", "", "");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT4(entries, 5, "/not", "", "/~!~", "/~!~");

// Applicators (object)
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT4(entries, 6, "/properties/foo", "", "/foo",
Expand Down
2 changes: 1 addition & 1 deletion test/jsonschema/jsonschema_official_walker_draft6_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ TEST(JSONSchema_official_walker_draft6, instance_locations) {
"/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT6(entries, 4, "/oneOf/0", "", "/~?~",
"/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT6(entries, 5, "/not", "", "", "");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT6(entries, 5, "/not", "", "/~!~", "/~!~");

// Applicators (object)
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT6(entries, 6, "/properties/foo", "", "/foo",
Expand Down
2 changes: 1 addition & 1 deletion test/jsonschema/jsonschema_official_walker_draft7_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ TEST(JSONSchema_official_walker_draft7, instance_locations) {
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT7(entries, 5, "/if", "", "/~?~", "/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT7(entries, 6, "/then", "", "/~?~", "/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT7(entries, 7, "/else", "", "/~?~", "/~?~");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT7(entries, 8, "/not", "", "", "");
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT7(entries, 8, "/not", "", "/~!~", "/~!~");

// Applicators (object)
EXPECT_OFFICIAL_WALKER_ENTRY_DRAFT7(entries, 9, "/properties/foo", "", "/foo",
Expand Down

5 comments on commit c41b28a

@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: c41b28a Previous: f7abd4f Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.5692301475777837 ns/iter 1.5722159646311986 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.5708691752428374 ns/iter 1.5700335173640776 ns/iter 1.00
Regex_Period_Asterisk 1.5762679396014643 ns/iter 1.5703089515806279 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 1.5674905975844422 ns/iter 1.5727802219421572 ns/iter 1.00
Regex_Period_Plus 1.8801343677673201 ns/iter 1.8832575727454344 ns/iter 1.00
Regex_Period 1.8794376250593472 ns/iter 1.8797131659947335 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 1.8868475120115695 ns/iter 1.8842786883673874 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 1.9077634295752566 ns/iter 1.8858197334094025 ns/iter 1.01
Regex_Caret_Period_Asterisk_Dollar 1.5739695963886926 ns/iter 1.5761471230760606 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.5764234692981867 ns/iter 1.5726553423954552 ns/iter 1.00
Regex_Caret_X_Hyphen 6.629596778608057 ns/iter 6.266414979743912 ns/iter 1.06
Regex_Period_Md_Dollar 67.40194462979154 ns/iter 67.80584824245294 ns/iter 0.99
Regex_Caret_Slash_Period_Asterisk 5.019031374665796 ns/iter 5.289936207217362 ns/iter 0.95
Regex_Caret_Period_Range_Dollar 2.196299572925401 ns/iter 2.1181082479868927 ns/iter 1.04
Regex_Nested_Backtrack 764.5440274710788 ns/iter 724.7249343837216 ns/iter 1.05
JSON_Array_Of_Objects_Unique 327.7946547475828 ns/iter 330.17275260601025 ns/iter 0.99
JSON_Parse_1 21792.47008837727 ns/iter 21350.58124029615 ns/iter 1.02
JSON_Fast_Hash_Helm_Chart_Lock 47.66577128274703 ns/iter 47.65216816899125 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 117.97103736909878 ns/iter 118.40090938486928 ns/iter 1.00
JSON_String_Equal/10 7.701656875667147 ns/iter 7.514781888778355 ns/iter 1.02
JSON_String_Equal/100 5.955832530655212 ns/iter 5.962866133075185 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 0.3133949892001073 ns/iter 0.3140510053900047 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 2.9090380774158 ns/iter 2.9231249313204213 ns/iter 1.00
JSON_String_Fast_Hash/10 1.5665060978146936 ns/iter 1.5691072860996222 ns/iter 1.00
JSON_String_Fast_Hash/100 1.8832482073246057 ns/iter 1.879556087154998 ns/iter 1.00
JSON_String_Key_Hash/10 1.266758732997893 ns/iter 1.2546043020639934 ns/iter 1.01
JSON_String_Key_Hash/100 1.2548976243109755 ns/iter 1.2548563434324669 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 2.3317007458069785 ns/iter 2.194953579352917 ns/iter 1.06
JSON_Object_Defines_Miss_Too_Small 2.218951414294393 ns/iter 2.2430098497662487 ns/iter 0.99
JSON_Object_Defines_Miss_Too_Large 2.2060245836394214 ns/iter 2.1932180649966666 ns/iter 1.01
Pointer_Object_Traverse 15.559746678306832 ns/iter 15.342584413742047 ns/iter 1.01
Pointer_Object_Try_Traverse 21.828988918756284 ns/iter 21.714676119332314 ns/iter 1.01
Pointer_Push_Back_Pointer_To_Weak_Pointer 170.84742443178027 ns/iter 171.35850287780875 ns/iter 1.00
Schema_Frame_OMC_Instances 163801239.50000325 ns/iter 158835031.25002107 ns/iter 1.03
Schema_Frame_OMC_References 97787327.28571932 ns/iter 95313577.28571622 ns/iter 1.03
Schema_Frame_OMC_Locations 95765553.57141712 ns/iter 92835974.00001043 ns/iter 1.03
Schema_Bundle_Meta_2020_12 4413673.162493836 ns/iter 4417883.0709707625 ns/iter 1.00

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: c41b28a Previous: f7abd4f Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.4902485551245626 ns/iter 2.528227332804628 ns/iter 0.98
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.4874359455816055 ns/iter 2.491443415979884 ns/iter 1.00
Regex_Period_Asterisk 2.4848477932678104 ns/iter 2.4941561274977038 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 2.484941988993644 ns/iter 2.4874704921699466 ns/iter 1.00
Regex_Period_Plus 2.7958585791680486 ns/iter 2.485028415644635 ns/iter 1.13
Regex_Period 2.7975224146037525 ns/iter 2.4859342628784766 ns/iter 1.13
Regex_Caret_Period_Plus_Dollar 2.7974442016207144 ns/iter 2.4929121076561938 ns/iter 1.12
Regex_Caret_Group_Period_Plus_Group_Dollar 2.7973849594693303 ns/iter 2.4912397914622577 ns/iter 1.12
Regex_Caret_Period_Asterisk_Dollar 3.73128170572061 ns/iter 2.8001563220995855 ns/iter 1.33
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.73056732134115 ns/iter 2.7987062041679023 ns/iter 1.33
Regex_Caret_X_Hyphen 13.047695675841984 ns/iter 13.117904618150003 ns/iter 0.99
Regex_Period_Md_Dollar 79.01553643873835 ns/iter 79.17763620904371 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 7.146828906036656 ns/iter 7.149806951722136 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 4.039662808728574 ns/iter 4.043564455554633 ns/iter 1.00
Regex_Nested_Backtrack 476.6488072191132 ns/iter 478.43019128324795 ns/iter 1.00
JSON_Array_Of_Objects_Unique 401.98130282867425 ns/iter 395.3111113362228 ns/iter 1.02
JSON_Parse_1 30665.92898704063 ns/iter 30909.49329451299 ns/iter 0.99
JSON_Fast_Hash_Helm_Chart_Lock 59.4009346819297 ns/iter 59.383991677243216 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 154.42499854694182 ns/iter 160.68245805660413 ns/iter 0.96
JSON_String_Equal/10 7.466329277624876 ns/iter 7.464084464077987 ns/iter 1.00
JSON_String_Equal/100 8.094059254741836 ns/iter 8.091623057825249 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9331381244933581 ns/iter 0.9340690234647068 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.597415589782713 ns/iter 10.256370877112273 ns/iter 1.42
JSON_String_Fast_Hash/10 2.174035469855495 ns/iter 2.1813483032612178 ns/iter 1.00
JSON_String_Fast_Hash/100 2.1742808048729616 ns/iter 2.178305343182798 ns/iter 1.00
JSON_String_Key_Hash/10 2.6520799640685184 ns/iter 2.2381238437925033 ns/iter 1.18
JSON_String_Key_Hash/100 2.176956796988355 ns/iter 2.1797480159931397 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.7360615123257155 ns/iter 3.735078627518476 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.7322605632397847 ns/iter 3.7335581255858297 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.7447450041950483 ns/iter 3.7352689694332786 ns/iter 1.00
Pointer_Object_Traverse 43.941461521267556 ns/iter 44.12965841220454 ns/iter 1.00
Pointer_Object_Try_Traverse 52.264650571939036 ns/iter 52.341817097530495 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 290.72952025007817 ns/iter 291.17892376162564 ns/iter 1.00
Schema_Frame_OMC_Instances 219304110.99998537 ns/iter 225418858.33334163 ns/iter 0.97
Schema_Frame_OMC_References 144624075.19999942 ns/iter 151196396.39999604 ns/iter 0.96
Schema_Frame_OMC_Locations 140592625.40000647 ns/iter 147946702.80000445 ns/iter 0.95
Schema_Bundle_Meta_2020_12 6878908.683164143 ns/iter 7018906.404036989 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: c41b28a Previous: f7abd4f Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 6.747343749999856 ns/iter 6.591603794642457 ns/iter 1.02
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 7.262651785713916 ns/iter 6.535811607142656 ns/iter 1.11
Regex_Period_Asterisk 6.558034598214135 ns/iter 6.726066964287521 ns/iter 0.98
Regex_Group_Period_Asterisk_Group 6.699136160714302 ns/iter 6.532040178571309 ns/iter 1.03
Regex_Period_Plus 6.8488627232150225 ns/iter 7.517465401785423 ns/iter 0.91
Regex_Period 6.878444165720747 ns/iter 7.02157857142741 ns/iter 0.98
Regex_Caret_Period_Plus_Dollar 6.864380580357781 ns/iter 7.064668526786429 ns/iter 0.97
Regex_Caret_Group_Period_Plus_Group_Dollar 6.844835937498723 ns/iter 6.841328124999839 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 6.786987499998938 ns/iter 6.806033482141974 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 6.561062499999691 ns/iter 6.55587500000213 ns/iter 1.00
Regex_Caret_X_Hyphen 11.874289285714214 ns/iter 11.94340714285756 ns/iter 0.99
Regex_Period_Md_Dollar 152.50939732146054 ns/iter 151.23337053571464 ns/iter 1.01
Regex_Caret_Slash_Period_Asterisk 10.108207812500325 ns/iter 9.975396874999376 ns/iter 1.01
Regex_Caret_Period_Range_Dollar 7.175305803571571 ns/iter 7.454834821429199 ns/iter 0.96
Regex_Nested_Backtrack 586.8116071427819 ns/iter 608.2824999998999 ns/iter 0.96
JSON_Array_Of_Objects_Unique 443.549499999989 ns/iter 408.326557663969 ns/iter 1.09
JSON_Parse_1 88334.7261282903 ns/iter 97027.84375001272 ns/iter 0.91
JSON_Fast_Hash_Helm_Chart_Lock 68.86366071427119 ns/iter 52.63757999998688 ns/iter 1.31
JSON_Equality_Helm_Chart_Lock 188.59874005347737 ns/iter 194.20989234021417 ns/iter 0.97
JSON_String_Equal/10 9.60519370712164 ns/iter 9.601576296422435 ns/iter 1.00
JSON_String_Equal/100 9.913335223603669 ns/iter 9.940062500000124 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 2.1645100422272088 ns/iter 2.1667950000001213 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.605419642858157 ns/iter 15.06482891697686 ns/iter 0.97
JSON_String_Fast_Hash/10 3.719101064787253 ns/iter 3.097514732142973 ns/iter 1.20
JSON_String_Fast_Hash/100 3.722146600495415 ns/iter 3.127190625000204 ns/iter 1.19
JSON_String_Key_Hash/10 7.764899965333233 ns/iter 7.75906603678857 ns/iter 1.00
JSON_String_Key_Hash/100 3.713402671940117 ns/iter 3.7300023147672445 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 4.0229475071847265 ns/iter 4.02832142857206 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.405368208205432 ns/iter 3.4161840563996146 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.717064279076022 ns/iter 3.7448480290269703 ns/iter 0.99
Pointer_Object_Traverse 49.140839285704324 ns/iter 49.88854000000629 ns/iter 0.99
Pointer_Object_Try_Traverse 74.28131696430385 ns/iter 65.29329464285638 ns/iter 1.14
Pointer_Push_Back_Pointer_To_Weak_Pointer 180.56859647933845 ns/iter 180.65468577275948 ns/iter 1.00
Schema_Frame_OMC_Instances 559822800.0001199 ns/iter 477966400.0000139 ns/iter 1.17
Schema_Frame_OMC_References 438135650.0000493 ns/iter 352420300.0000625 ns/iter 1.24
Schema_Frame_OMC_Locations 416376249.9999848 ns/iter 344666950.00003254 ns/iter 1.21
Schema_Bundle_Meta_2020_12 18719221.621636648 ns/iter 16320197.777769055 ns/iter 1.15

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: c41b28a Previous: f7abd4f Ratio
Schema_Frame_OMC_Instances 216719212.99999514 ns/iter 218077016.00001416 ns/iter 0.99
Schema_Frame_OMC_References 142728162.59999675 ns/iter 143988287.19999984 ns/iter 0.99
Schema_Frame_OMC_Locations 138313381.00001174 ns/iter 138467686.8000042 ns/iter 1.00
Schema_Bundle_Meta_2020_12 6943131.280005446 ns/iter 6985880.0199995125 ns/iter 0.99
Pointer_Object_Traverse 47.4780124999376 ns/iter 48.75677063571721 ns/iter 0.97
Pointer_Object_Try_Traverse 23.343586974671627 ns/iter 23.66629497121579 ns/iter 0.99
Pointer_Push_Back_Pointer_To_Weak_Pointer 163.1854320788677 ns/iter 133.95751544243032 ns/iter 1.22
JSON_Array_Of_Objects_Unique 393.78029080064323 ns/iter 392.3005145264427 ns/iter 1.00
JSON_Parse_1 33225.58808364295 ns/iter 33271.647134734696 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 69.32474619228756 ns/iter 63.99817167778547 ns/iter 1.08
JSON_Equality_Helm_Chart_Lock 150.9848929028542 ns/iter 159.8029833094738 ns/iter 0.94
JSON_String_Equal/10 6.03330918635983 ns/iter 6.29979192278426 ns/iter 0.96
JSON_String_Equal/100 6.648916685429248 ns/iter 6.926371802680709 ns/iter 0.96
JSON_String_Equal_Small_By_Perfect_Hash/10 0.6242020319188121 ns/iter 0.9343225233651848 ns/iter 0.67
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 11.610388020341823 ns/iter 25.47958080939866 ns/iter 0.46
JSON_String_Fast_Hash/10 1.279208209187818 ns/iter 0.9329028451610182 ns/iter 1.37
JSON_String_Fast_Hash/100 1.2596001076673868 ns/iter 0.9333210450821847 ns/iter 1.35
JSON_String_Key_Hash/10 1.2453425107071334 ns/iter 1.2473091166686334 ns/iter 1.00
JSON_String_Key_Hash/100 0.9368217724274304 ns/iter 0.9344372689294987 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 2.8041558658260577 ns/iter 2.4965556614362248 ns/iter 1.12
JSON_Object_Defines_Miss_Too_Small 2.491614368137437 ns/iter 2.4945681525570915 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 2.493804831198788 ns/iter 2.8006129361094896 ns/iter 0.89
Regex_Lower_S_Or_Upper_S_Asterisk 3.1131302137937698 ns/iter 3.120514988327591 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.8016660028135214 ns/iter 3.1150386963565935 ns/iter 0.90
Regex_Period_Asterisk 2.80411555504235 ns/iter 3.115370296178994 ns/iter 0.90
Regex_Group_Period_Asterisk_Group 2.798065695058171 ns/iter 3.1162139251363556 ns/iter 0.90
Regex_Period_Plus 3.1127216483708384 ns/iter 3.1093411706428973 ns/iter 1.00
Regex_Period 3.121928828049609 ns/iter 3.1153114915588462 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 3.1169917095323694 ns/iter 3.1089684112298044 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 3.2326634844001934 ns/iter 3.433454104395632 ns/iter 0.94
Regex_Caret_Period_Asterisk_Dollar 3.1115924973350846 ns/iter 4.351095557639307 ns/iter 0.72
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.4035536881754327 ns/iter 4.351569133125234 ns/iter 0.78
Regex_Caret_X_Hyphen 13.677708958018394 ns/iter 13.078812205904075 ns/iter 1.05
Regex_Period_Md_Dollar 90.42224513830979 ns/iter 88.81489593329934 ns/iter 1.02
Regex_Caret_Slash_Period_Asterisk 8.70436585207164 ns/iter 8.716655844828402 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 4.352060342889756 ns/iter 4.359564265738541 ns/iter 1.00
Regex_Nested_Backtrack 810.1667796405934 ns/iter 825.4775804341872 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: c41b28a Previous: f7abd4f Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.0453499079484034 ns/iter 1.884306037948282 ns/iter 1.09
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.0429963434080025 ns/iter 1.8844911031052325 ns/iter 1.08
Regex_Period_Asterisk 1.9815133745132618 ns/iter 1.8857829687696672 ns/iter 1.05
Regex_Group_Period_Asterisk_Group 2.055665338911642 ns/iter 1.879990543998337 ns/iter 1.09
Regex_Period_Plus 1.7751411073215824 ns/iter 1.56724159364316 ns/iter 1.13
Regex_Period 1.874307012596824 ns/iter 1.5876240425192623 ns/iter 1.18
Regex_Caret_Period_Plus_Dollar 1.6958978639316373 ns/iter 1.916517694770378 ns/iter 0.88
Regex_Caret_Group_Period_Plus_Group_Dollar 1.641073182083959 ns/iter 1.5741505382179979 ns/iter 1.04
Regex_Caret_Period_Asterisk_Dollar 1.9474290916587955 ns/iter 1.8820254523581983 ns/iter 1.03
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.0259891913335095 ns/iter 1.8857773275772003 ns/iter 1.07
Regex_Caret_X_Hyphen 6.110268082122842 ns/iter 5.970461637184232 ns/iter 1.02
Regex_Period_Md_Dollar 71.01508343143476 ns/iter 69.03779184232768 ns/iter 1.03
Regex_Caret_Slash_Period_Asterisk 4.419709747686884 ns/iter 4.386049408984154 ns/iter 1.01
Regex_Caret_Period_Range_Dollar 1.9430878457776868 ns/iter 1.8934081200488422 ns/iter 1.03
Regex_Nested_Backtrack 852.2365697723487 ns/iter 821.1441819743591 ns/iter 1.04
JSON_Array_Of_Objects_Unique 209.41177862067659 ns/iter 211.41809235829416 ns/iter 0.99
JSON_Parse_1 24146.683257406297 ns/iter 22946.175411533033 ns/iter 1.05
JSON_Fast_Hash_Helm_Chart_Lock 23.313521527478596 ns/iter 23.609601742144 ns/iter 0.99
JSON_Equality_Helm_Chart_Lock 113.58436283814756 ns/iter 113.41726369429765 ns/iter 1.00
JSON_String_Equal/10 5.5627892807567925 ns/iter 5.379697794266586 ns/iter 1.03
JSON_String_Equal/100 5.284822023419054 ns/iter 5.060142003967191 ns/iter 1.04
JSON_String_Equal_Small_By_Perfect_Hash/10 0.7446556239486871 ns/iter 0.7447189410153496 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.5671186432191213 ns/iter 3.4926738595973985 ns/iter 1.02
JSON_String_Fast_Hash/10 1.9987720604814998 ns/iter 1.8923757774560472 ns/iter 1.06
JSON_String_Fast_Hash/100 1.894633513394398 ns/iter 1.8942568893997507 ns/iter 1.00
JSON_String_Key_Hash/10 1.4440694971827914 ns/iter 1.435642933575605 ns/iter 1.01
JSON_String_Key_Hash/100 1.922682232912587 ns/iter 1.9188875154131713 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 1.7371083091824644 ns/iter 1.7229066534727897 ns/iter 1.01
JSON_Object_Defines_Miss_Too_Small 2.0031412635117487 ns/iter 1.8934397100884426 ns/iter 1.06
JSON_Object_Defines_Miss_Too_Large 1.726508768787382 ns/iter 1.753438036793093 ns/iter 0.98
Pointer_Object_Traverse 52.949938703528474 ns/iter 52.5896575877318 ns/iter 1.01
Pointer_Object_Try_Traverse 37.0404270482758 ns/iter 36.81867152224081 ns/iter 1.01
Pointer_Push_Back_Pointer_To_Weak_Pointer 169.4814705772367 ns/iter 156.24314512237336 ns/iter 1.08
Schema_Frame_OMC_Instances 173647999.76348877 ns/iter 168222248.55422974 ns/iter 1.03
Schema_Frame_OMC_References 114834022.52197266 ns/iter 101229258.94601004 ns/iter 1.13
Schema_Frame_OMC_Locations 101314851.2159075 ns/iter 97924573.0808803 ns/iter 1.03
Schema_Bundle_Meta_2020_12 4680665.334065755 ns/iter 4651994.513185232 ns/iter 1.01

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

Please sign in to comment.