Skip to content

Commit

Permalink
Implement a Conditional token for PointerTemplate (#1567)
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 68c124e commit 77e6776
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ namespace sourcemeta::core {
/// @ingroup jsonpointer
template <typename PointerT> class GenericPointerTemplate {
public:
/// The type of wildcard
enum class Wildcard { Property, Item, Key };

struct Conditional {
auto operator==(const Conditional &) const noexcept -> bool = default;
auto operator<(const Conditional &) const noexcept -> bool { return false; }
};
using Regex = typename PointerT::Value::String;
using Token = typename PointerT::Token;
using Container = std::vector<std::variant<Token, Wildcard, Regex>>;
using Container =
std::vector<std::variant<Wildcard, Conditional, Regex, Token>>;

/// This constructor creates an empty JSON Pointer template. For example:
///
Expand Down
6 changes: 6 additions & 0 deletions src/core/jsonpointer/stringify.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,12 @@ auto stringify(const PointerT &pointer,
const auto &value{std::get<typename PointerT::Regex>(token)};
stream.write(value.c_str(), static_cast<std::streamsize>(value.size()));
stream.put(internal::token_pointer_tilde<CharT>);
} else if (std::holds_alternative<typename PointerT::Conditional>(
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
42 changes: 42 additions & 0 deletions test/jsonpointer/jsonpointer_template_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,36 @@ TEST(JSONPointer_template, equality_with_key_wildcard_false) {
EXPECT_NE(left, right);
}

TEST(JSONPointer_template, equality_with_conditional_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::Conditional{});
left.push_back(suffix);

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

EXPECT_EQ(left, right);
}

TEST(JSONPointer_template, equality_with_conditional_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::Conditional{});
left.push_back(suffix);

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

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 @@ -202,6 +232,18 @@ TEST(JSONPointer_template, stringify_key_wildcard) {
EXPECT_EQ(stream.str(), "/foo/bar/~K~");
}

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

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

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

7 comments on commit 77e6776

@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: 77e6776 Previous: 68c124e Ratio
Schema_Frame_OMC_Instances 223270361.66666403 ns/iter 214558458.33334783 ns/iter 1.04
Schema_Frame_OMC_References 145566661.99998742 ns/iter 141707572.20001632 ns/iter 1.03
Schema_Frame_OMC_Locations 141699328.40000004 ns/iter 136831988.39999023 ns/iter 1.04
Schema_Bundle_Meta_2020_12 6960560.630004693 ns/iter 6995591.25773375 ns/iter 0.99
Pointer_Object_Traverse 48.519232461121405 ns/iter 48.599719723993054 ns/iter 1.00
Pointer_Object_Try_Traverse 23.661957421892943 ns/iter 23.648689740284865 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 166.20152688980343 ns/iter 165.22073618119936 ns/iter 1.01
JSON_Array_Of_Objects_Unique 399.98080576447506 ns/iter 380.43163705620134 ns/iter 1.05
JSON_Parse_1 33039.20716716673 ns/iter 33081.708410330386 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 69.90266604842287 ns/iter 69.62460422849816 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 151.0191641359595 ns/iter 155.59569945686016 ns/iter 0.97
JSON_String_Equal/10 5.9488486681816966 ns/iter 6.2657097672515345 ns/iter 0.95
JSON_String_Equal/100 6.571306145924076 ns/iter 6.880790682814632 ns/iter 0.96
JSON_String_Equal_Small_By_Perfect_Hash/10 0.6232584538760886 ns/iter 0.6250487303585126 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 25.46627057911504 ns/iter 25.45944152180835 ns/iter 1.00
JSON_String_Fast_Hash/10 1.2472425769433297 ns/iter 1.2430297413406377 ns/iter 1.00
JSON_String_Fast_Hash/100 1.2461168745100308 ns/iter 1.2433145256849523 ns/iter 1.00
JSON_String_Key_Hash/10 1.2451597368488738 ns/iter 1.2491346968481984 ns/iter 1.00
JSON_String_Key_Hash/100 0.9345129321857555 ns/iter 0.9335413921863084 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 2.7976870166268615 ns/iter 2.7979724021063914 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 2.487172199808301 ns/iter 2.493050471952655 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 2.488746843970287 ns/iter 2.4877416405057873 ns/iter 1.00
Regex_Lower_S_Or_Upper_S_Asterisk 3.1095118363911722 ns/iter 3.1067066557946457 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.799188198004616 ns/iter 2.797541797838099 ns/iter 1.00
Regex_Period_Asterisk 2.799671012901838 ns/iter 2.798511208039987 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 2.797635742702456 ns/iter 2.8018337066446217 ns/iter 1.00
Regex_Period_Plus 3.1100707172575084 ns/iter 3.115966498740375 ns/iter 1.00
Regex_Period 3.108078653920549 ns/iter 3.115390548093061 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 3.1078007093529125 ns/iter 3.1521696769746734 ns/iter 0.99
Regex_Caret_Group_Period_Plus_Group_Dollar 3.1079265116131483 ns/iter 3.1093175194819813 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 4.041795721230115 ns/iter 4.038264788694094 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 4.044250252986236 ns/iter 4.044992504566849 ns/iter 1.00
Regex_Caret_X_Hyphen 13.685516627040075 ns/iter 13.677360503133675 ns/iter 1.00
Regex_Period_Md_Dollar 88.96565867918441 ns/iter 89.49144678797961 ns/iter 0.99
Regex_Caret_Slash_Period_Asterisk 9.01479148809629 ns/iter 9.019325051328659 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 4.040653306161581 ns/iter 4.040137656249114 ns/iter 1.00
Regex_Nested_Backtrack 820.7140822891898 ns/iter 823.7334829679808 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 (macos/llvm)

Benchmark suite Current: 77e6776 Previous: 68c124e Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.585158809182125 ns/iter 1.8002220868284844 ns/iter 0.88
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.5787154198740783 ns/iter 1.7021727432580855 ns/iter 0.93
Regex_Period_Asterisk 1.662718662715078 ns/iter 1.6530997168996973 ns/iter 1.01
Regex_Group_Period_Asterisk_Group 1.5872965019163743 ns/iter 1.6529078355618423 ns/iter 0.96
Regex_Period_Plus 1.90247450600225 ns/iter 1.9174200221545032 ns/iter 0.99
Regex_Period 1.9331379584423778 ns/iter 1.9646582775517307 ns/iter 0.98
Regex_Caret_Period_Plus_Dollar 1.8938725772082927 ns/iter 1.912292517877115 ns/iter 0.99
Regex_Caret_Group_Period_Plus_Group_Dollar 1.987298620974047 ns/iter 2.066930351941701 ns/iter 0.96
Regex_Caret_Period_Asterisk_Dollar 1.5959280076940303 ns/iter 2.178420159769647 ns/iter 0.73
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.6054223138001709 ns/iter 1.7500737102508246 ns/iter 0.92
Regex_Caret_X_Hyphen 6.92481697913078 ns/iter 7.473959893308449 ns/iter 0.93
Regex_Period_Md_Dollar 74.7474341773725 ns/iter 79.26755385519739 ns/iter 0.94
Regex_Caret_Slash_Period_Asterisk 5.092916857135769 ns/iter 5.316940666810516 ns/iter 0.96
Regex_Caret_Period_Range_Dollar 2.2221766650572463 ns/iter 2.3586177377790256 ns/iter 0.94
Regex_Nested_Backtrack 754.8613726125093 ns/iter 854.9593595088788 ns/iter 0.88
JSON_Array_Of_Objects_Unique 328.8900533049157 ns/iter 373.1223238079382 ns/iter 0.88
JSON_Parse_1 23453.41251848097 ns/iter 22807.595505618512 ns/iter 1.03
JSON_Fast_Hash_Helm_Chart_Lock 47.94853603087678 ns/iter 50.6914802624484 ns/iter 0.95
JSON_Equality_Helm_Chart_Lock 118.19920162399161 ns/iter 125.96732136820775 ns/iter 0.94
JSON_String_Equal/10 7.573443830731693 ns/iter 8.40742090730789 ns/iter 0.90
JSON_String_Equal/100 6.052825678791757 ns/iter 6.16969826140275 ns/iter 0.98
JSON_String_Equal_Small_By_Perfect_Hash/10 0.366655914781596 ns/iter 0.3178777776630783 ns/iter 1.15
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 2.9621379854009673 ns/iter 2.973205291756201 ns/iter 1.00
JSON_String_Fast_Hash/10 1.6142918773461352 ns/iter 1.5837750884631634 ns/iter 1.02
JSON_String_Fast_Hash/100 2.01548109992483 ns/iter 1.9936205003641063 ns/iter 1.01
JSON_String_Key_Hash/10 1.334175870469328 ns/iter 1.2752013280753978 ns/iter 1.05
JSON_String_Key_Hash/100 1.3570886178302468 ns/iter 1.3011135561297236 ns/iter 1.04
JSON_Object_Defines_Miss_Same_Length 2.3804636936072816 ns/iter 2.2455102816770216 ns/iter 1.06
JSON_Object_Defines_Miss_Too_Small 2.3186485058953137 ns/iter 2.272520025859497 ns/iter 1.02
JSON_Object_Defines_Miss_Too_Large 2.3610268020027014 ns/iter 2.3340339994515857 ns/iter 1.01
Pointer_Object_Traverse 16.001508342816514 ns/iter 16.859713027068036 ns/iter 0.95
Pointer_Object_Try_Traverse 23.327787630209556 ns/iter 23.733884470755132 ns/iter 0.98
Pointer_Push_Back_Pointer_To_Weak_Pointer 172.44069593303848 ns/iter 181.0343344350036 ns/iter 0.95
Schema_Frame_OMC_Instances 190078073.00002354 ns/iter 188241593.75000703 ns/iter 1.01
Schema_Frame_OMC_References 117236648.71429458 ns/iter 108061888.99999826 ns/iter 1.08
Schema_Frame_OMC_Locations 102234392.85714772 ns/iter 101604916.66666378 ns/iter 1.01
Schema_Bundle_Meta_2020_12 4813920.397258206 ns/iter 5128864.150001391 ns/iter 0.94

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: 77e6776 Previous: 68c124e Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.4872980227903856 ns/iter 2.4999178930349304 ns/iter 0.99
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.589384973934662 ns/iter 2.4873585553502053 ns/iter 1.04
Regex_Period_Asterisk 2.486101624244829 ns/iter 2.4890779426839305 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 2.4854424635300854 ns/iter 2.4890697596762097 ns/iter 1.00
Regex_Period_Plus 2.798456359938612 ns/iter 2.7987884362889837 ns/iter 1.00
Regex_Period 2.8000862501140533 ns/iter 2.8055372875729736 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 2.4864100816244887 ns/iter 2.798714688912704 ns/iter 0.89
Regex_Caret_Group_Period_Plus_Group_Dollar 2.4860651724650507 ns/iter 2.803366448099378 ns/iter 0.89
Regex_Caret_Period_Asterisk_Dollar 2.487304818564836 ns/iter 3.730105836525368 ns/iter 0.67
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.486048043070529 ns/iter 3.7290033760607684 ns/iter 0.67
Regex_Caret_X_Hyphen 12.431939972072827 ns/iter 13.05266452632346 ns/iter 0.95
Regex_Period_Md_Dollar 78.0864229865032 ns/iter 79.90417101717624 ns/iter 0.98
Regex_Caret_Slash_Period_Asterisk 6.2135581577084515 ns/iter 7.151055832782667 ns/iter 0.87
Regex_Caret_Period_Range_Dollar 4.042431735422335 ns/iter 4.039216083447578 ns/iter 1.00
Regex_Nested_Backtrack 475.27330436249827 ns/iter 481.4957801011232 ns/iter 0.99
JSON_Array_Of_Objects_Unique 404.3512588328083 ns/iter 436.6919923407332 ns/iter 0.93
JSON_Parse_1 30414.42482472135 ns/iter 30593.25592396083 ns/iter 0.99
JSON_Fast_Hash_Helm_Chart_Lock 59.414531309876615 ns/iter 56.2582869657147 ns/iter 1.06
JSON_Equality_Helm_Chart_Lock 152.76309182096247 ns/iter 146.88976143927275 ns/iter 1.04
JSON_String_Equal/10 7.4650014293153975 ns/iter 5.911366903911101 ns/iter 1.26
JSON_String_Equal/100 8.082771066125389 ns/iter 6.098618502036184 ns/iter 1.33
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9348098545404621 ns/iter 0.9338309287362869 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.787917073774157 ns/iter 14.598569697650149 ns/iter 1.01
JSON_String_Fast_Hash/10 2.177888470691627 ns/iter 2.176955093915857 ns/iter 1.00
JSON_String_Fast_Hash/100 2.1781340152846753 ns/iter 2.1755488652507475 ns/iter 1.00
JSON_String_Key_Hash/10 2.693995338501876 ns/iter 2.6409282728853154 ns/iter 1.02
JSON_String_Key_Hash/100 2.1821808357804695 ns/iter 2.1790841140800326 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.7382809200443603 ns/iter 3.737246017040291 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.7394816729967695 ns/iter 3.7370696722011263 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.735173954349847 ns/iter 3.7396864465343027 ns/iter 1.00
Pointer_Object_Traverse 43.59781288562094 ns/iter 43.19505365515155 ns/iter 1.01
Pointer_Object_Try_Traverse 52.94047066181375 ns/iter 52.68989858774859 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 290.7093776364662 ns/iter 290.5869973166965 ns/iter 1.00
Schema_Frame_OMC_Instances 221117337.0000097 ns/iter 222665674.99999228 ns/iter 0.99
Schema_Frame_OMC_References 145110335.20000184 ns/iter 147345138.99999228 ns/iter 0.98
Schema_Frame_OMC_Locations 138852084.2000162 ns/iter 142451807.60000268 ns/iter 0.97
Schema_Bundle_Meta_2020_12 6889832.871294884 ns/iter 6886238.683167934 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 (macos/gcc)

Benchmark suite Current: 77e6776 Previous: 68c124e Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.634890555375875 ns/iter 1.8848500362887277 ns/iter 1.40
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.401778159441907 ns/iter 1.8960553544289862 ns/iter 1.27
Regex_Period_Asterisk 2.170686181789142 ns/iter 1.8808711857562102 ns/iter 1.15
Regex_Group_Period_Asterisk_Group 2.3660449456322667 ns/iter 1.9205122894651592 ns/iter 1.23
Regex_Period_Plus 2.106510426681479 ns/iter 1.6960694121644182 ns/iter 1.24
Regex_Period 1.949849380975414 ns/iter 1.613404091573941 ns/iter 1.21
Regex_Caret_Period_Plus_Dollar 1.737283480456751 ns/iter 1.6298764554859086 ns/iter 1.07
Regex_Caret_Group_Period_Plus_Group_Dollar 1.7567266254793863 ns/iter 1.5877733840608104 ns/iter 1.11
Regex_Caret_Period_Asterisk_Dollar 2.2056601324792617 ns/iter 1.8938550552077271 ns/iter 1.16
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.1950683461009652 ns/iter 1.8869370043816078 ns/iter 1.16
Regex_Caret_X_Hyphen 8.031592137067209 ns/iter 5.987203554350188 ns/iter 1.34
Regex_Period_Md_Dollar 81.61450788760429 ns/iter 69.26360509609816 ns/iter 1.18
Regex_Caret_Slash_Period_Asterisk 4.848487909241737 ns/iter 4.496934578219926 ns/iter 1.08
Regex_Caret_Period_Range_Dollar 2.073694224400474 ns/iter 1.9335950932222952 ns/iter 1.07
Regex_Nested_Backtrack 926.7887871674028 ns/iter 872.3973823189359 ns/iter 1.06
JSON_Array_Of_Objects_Unique 232.59475921810446 ns/iter 222.55293789188391 ns/iter 1.05
JSON_Parse_1 28063.932423869137 ns/iter 24693.798362859263 ns/iter 1.14
JSON_Fast_Hash_Helm_Chart_Lock 27.59041901721177 ns/iter 25.03307415598048 ns/iter 1.10
JSON_Equality_Helm_Chart_Lock 133.51989695899584 ns/iter 115.26095567233268 ns/iter 1.16
JSON_String_Equal/10 6.302138170266631 ns/iter 5.731514759320953 ns/iter 1.10
JSON_String_Equal/100 6.687320424217791 ns/iter 5.388280203699465 ns/iter 1.24
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9772541387168847 ns/iter 0.7980466321769818 ns/iter 1.22
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 5.342103830827748 ns/iter 3.6832605596617825 ns/iter 1.45
JSON_String_Fast_Hash/10 2.2884158231003915 ns/iter 2.0064032893593007 ns/iter 1.14
JSON_String_Fast_Hash/100 2.2465543399848014 ns/iter 2.010289025430344 ns/iter 1.12
JSON_String_Key_Hash/10 1.6729442673546913 ns/iter 1.513614167683686 ns/iter 1.11
JSON_String_Key_Hash/100 2.2261138938760925 ns/iter 2.042332663526145 ns/iter 1.09
JSON_Object_Defines_Miss_Same_Length 2.014865959412488 ns/iter 1.8292481648725025 ns/iter 1.10
JSON_Object_Defines_Miss_Too_Small 2.174436353142843 ns/iter 1.9719313587158782 ns/iter 1.10
JSON_Object_Defines_Miss_Too_Large 1.876140933158865 ns/iter 1.825462084356106 ns/iter 1.03
Pointer_Object_Traverse 59.11191171571659 ns/iter 53.88653875246315 ns/iter 1.10
Pointer_Object_Try_Traverse 41.307170205648966 ns/iter 36.72155738320954 ns/iter 1.12
Pointer_Push_Back_Pointer_To_Weak_Pointer 177.64566675818108 ns/iter 161.97287400418261 ns/iter 1.10
Schema_Frame_OMC_Instances 227715969.08569336 ns/iter 176414966.58325195 ns/iter 1.29
Schema_Frame_OMC_References 174039483.07037354 ns/iter 107088168.46211751 ns/iter 1.63
Schema_Frame_OMC_Locations 147779750.8239746 ns/iter 100919553.21175711 ns/iter 1.46
Schema_Bundle_Meta_2020_12 7261746.889585025 ns/iter 4812681.75605203 ns/iter 1.51

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: 77e6776 Previous: 68c124e Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 6.940703571428587 ns/iter 6.8076529017854375 ns/iter 1.02
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 6.557703571429231 ns/iter 6.555293526785886 ns/iter 1.00
Regex_Period_Asterisk 6.598361607141255 ns/iter 6.6341964285727375 ns/iter 0.99
Regex_Group_Period_Asterisk_Group 6.664167410715801 ns/iter 6.546059151784077 ns/iter 1.02
Regex_Period_Plus 7.119687021785976 ns/iter 6.9680558035705475 ns/iter 1.02
Regex_Period 6.920111607142993 ns/iter 7.286041294641673 ns/iter 0.95
Regex_Caret_Period_Plus_Dollar 7.13882857142778 ns/iter 7.089724330356769 ns/iter 1.01
Regex_Caret_Group_Period_Plus_Group_Dollar 6.954892857142474 ns/iter 7.106035714287933 ns/iter 0.98
Regex_Caret_Period_Asterisk_Dollar 6.8324803571430595 ns/iter 6.636832589284682 ns/iter 1.03
Regex_Caret_Group_Period_Asterisk_Group_Dollar 6.703224330357115 ns/iter 6.92871093750063 ns/iter 0.97
Regex_Caret_X_Hyphen 11.915483928569463 ns/iter 14.400957589287039 ns/iter 0.83
Regex_Period_Md_Dollar 150.3558415019871 ns/iter 150.14609375003016 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 10.060096875001534 ns/iter 10.020448437501273 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 7.234364955357769 ns/iter 7.601808035713832 ns/iter 0.95
Regex_Nested_Backtrack 589.3670535714688 ns/iter 588.4979464285932 ns/iter 1.00
JSON_Array_Of_Objects_Unique 404.5068792631255 ns/iter 425.0561640600099 ns/iter 0.95
JSON_Parse_1 100709.01562500012 ns/iter 78810.7589285809 ns/iter 1.28
JSON_Fast_Hash_Helm_Chart_Lock 54.143020000014985 ns/iter 60.38197321428486 ns/iter 0.90
JSON_Equality_Helm_Chart_Lock 198.12797106569357 ns/iter 191.32890101152265 ns/iter 1.04
JSON_String_Equal/10 9.662424064008244 ns/iter 9.289947279957472 ns/iter 1.04
JSON_String_Equal/100 10.017657812497305 ns/iter 9.913143750001296 ns/iter 1.01
JSON_String_Equal_Small_By_Perfect_Hash/10 2.1747506250001436 ns/iter 2.164396874999852 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.640549107142979 ns/iter 14.271348341932027 ns/iter 1.03
JSON_String_Fast_Hash/10 3.1127566964284723 ns/iter 3.0992200892865998 ns/iter 1.00
JSON_String_Fast_Hash/100 3.103501785714359 ns/iter 3.100034375000251 ns/iter 1.00
JSON_String_Key_Hash/10 7.52632228782842 ns/iter 7.4406941964281055 ns/iter 1.01
JSON_String_Key_Hash/100 3.760152314714022 ns/iter 3.720885061150606 ns/iter 1.01
JSON_Object_Defines_Miss_Same_Length 4.032286614343379 ns/iter 4.02261272321347 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.417642538540093 ns/iter 3.4043629849927433 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.7270087433457295 ns/iter 3.715488275444137 ns/iter 1.00
Pointer_Object_Traverse 49.917169999980615 ns/iter 52.18035000000327 ns/iter 0.96
Pointer_Object_Try_Traverse 64.98913392856511 ns/iter 64.89717633930374 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 190.8700616848723 ns/iter 170.488397577368 ns/iter 1.12
Schema_Frame_OMC_Instances 506854500.00014496 ns/iter 483939399.99994016 ns/iter 1.05
Schema_Frame_OMC_References 375104749.9999913 ns/iter 351353000.00001734 ns/iter 1.07
Schema_Frame_OMC_Locations 358003150.00005865 ns/iter 343871949.9999934 ns/iter 1.04
Schema_Bundle_Meta_2020_12 16807797.560947686 ns/iter 16298613.3333258 ns/iter 1.03

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: 77e6776 Previous: 68c124e Ratio
Schema_Frame_OMC_Instances 229058512.66667318 ns/iter 214558458.33334783 ns/iter 1.07
Schema_Frame_OMC_References 145941907.40001523 ns/iter 141707572.20001632 ns/iter 1.03
Schema_Frame_OMC_Locations 142484925.6000016 ns/iter 136831988.39999023 ns/iter 1.04
Schema_Bundle_Meta_2020_12 7048925.909093714 ns/iter 6995591.25773375 ns/iter 1.01
Pointer_Object_Traverse 45.899549515159876 ns/iter 48.599719723993054 ns/iter 0.94
Pointer_Object_Try_Traverse 23.038669504718584 ns/iter 23.648689740284865 ns/iter 0.97
Pointer_Push_Back_Pointer_To_Weak_Pointer 155.61581079852826 ns/iter 165.22073618119936 ns/iter 0.94
JSON_Array_Of_Objects_Unique 396.78037280710237 ns/iter 380.43163705620134 ns/iter 1.04
JSON_Parse_1 33619.18196248267 ns/iter 33081.708410330386 ns/iter 1.02
JSON_Fast_Hash_Helm_Chart_Lock 69.31439252063481 ns/iter 69.62460422849816 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 152.96042033326154 ns/iter 155.59569945686016 ns/iter 0.98
JSON_String_Equal/10 5.957985534402069 ns/iter 6.2657097672515345 ns/iter 0.95
JSON_String_Equal/100 6.263065284403933 ns/iter 6.880790682814632 ns/iter 0.91
JSON_String_Equal_Small_By_Perfect_Hash/10 0.6232328304273155 ns/iter 0.6250487303585126 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 11.66672267713877 ns/iter 25.45944152180835 ns/iter 0.46
JSON_String_Fast_Hash/10 0.932468195478876 ns/iter 1.2430297413406377 ns/iter 0.75
JSON_String_Fast_Hash/100 0.9323636048794199 ns/iter 1.2433145256849523 ns/iter 0.75
JSON_String_Key_Hash/10 1.244930148120793 ns/iter 1.2491346968481984 ns/iter 1.00
JSON_String_Key_Hash/100 0.9360983843153521 ns/iter 0.9335413921863084 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 2.494903006795767 ns/iter 2.7979724021063914 ns/iter 0.89
JSON_Object_Defines_Miss_Too_Small 2.4912854100389463 ns/iter 2.493050471952655 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 2.7975985114960147 ns/iter 2.4877416405057873 ns/iter 1.12
Regex_Lower_S_Or_Upper_S_Asterisk 3.152348421809596 ns/iter 3.1067066557946457 ns/iter 1.01
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 3.128721657067897 ns/iter 2.797541797838099 ns/iter 1.12
Regex_Period_Asterisk 3.1457169718544264 ns/iter 2.798511208039987 ns/iter 1.12
Regex_Group_Period_Asterisk_Group 3.1098189686263966 ns/iter 2.8018337066446217 ns/iter 1.11
Regex_Period_Plus 3.4200060897719147 ns/iter 3.115966498740375 ns/iter 1.10
Regex_Period 3.425312409660974 ns/iter 3.115390548093061 ns/iter 1.10
Regex_Caret_Period_Plus_Dollar 3.4184430683039446 ns/iter 3.1521696769746734 ns/iter 1.08
Regex_Caret_Group_Period_Plus_Group_Dollar 3.418823643561412 ns/iter 3.1093175194819813 ns/iter 1.10
Regex_Caret_Period_Asterisk_Dollar 4.360600593599682 ns/iter 4.038264788694094 ns/iter 1.08
Regex_Caret_Group_Period_Asterisk_Group_Dollar 4.356006420520347 ns/iter 4.044992504566849 ns/iter 1.08
Regex_Caret_X_Hyphen 13.680643331786705 ns/iter 13.677360503133675 ns/iter 1.00
Regex_Period_Md_Dollar 89.27662053180033 ns/iter 89.49144678797961 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 9.328815473949861 ns/iter 9.019325051328659 ns/iter 1.03
Regex_Caret_Period_Range_Dollar 4.351185178836903 ns/iter 4.040137656249114 ns/iter 1.08
Regex_Nested_Backtrack 834.7369809647031 ns/iter 823.7334829679808 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: 77e6776 Previous: 68c124e Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.9069784325959624 ns/iter 1.8848500362887277 ns/iter 1.01
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.9470717556404034 ns/iter 1.8960553544289862 ns/iter 1.03
Regex_Period_Asterisk 1.9024153573809581 ns/iter 1.8808711857562102 ns/iter 1.01
Regex_Group_Period_Asterisk_Group 1.9222681274458828 ns/iter 1.9205122894651592 ns/iter 1.00
Regex_Period_Plus 1.6218304993231716 ns/iter 1.6960694121644182 ns/iter 0.96
Regex_Period 1.6863694602960217 ns/iter 1.613404091573941 ns/iter 1.05
Regex_Caret_Period_Plus_Dollar 1.9684068973878177 ns/iter 1.6298764554859086 ns/iter 1.21
Regex_Caret_Group_Period_Plus_Group_Dollar 1.6573324820997803 ns/iter 1.5877733840608104 ns/iter 1.04
Regex_Caret_Period_Asterisk_Dollar 1.9531654302931987 ns/iter 1.8938550552077271 ns/iter 1.03
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.214436640810332 ns/iter 1.8869370043816078 ns/iter 1.17
Regex_Caret_X_Hyphen 6.241427913198439 ns/iter 5.987203554350188 ns/iter 1.04
Regex_Period_Md_Dollar 72.25332310445805 ns/iter 69.26360509609816 ns/iter 1.04
Regex_Caret_Slash_Period_Asterisk 4.8473537781493805 ns/iter 4.496934578219926 ns/iter 1.08
Regex_Caret_Period_Range_Dollar 1.9612810846289057 ns/iter 1.9335950932222952 ns/iter 1.01
Regex_Nested_Backtrack 850.2977291155084 ns/iter 872.3973823189359 ns/iter 0.97
JSON_Array_Of_Objects_Unique 216.9881046872456 ns/iter 222.55293789188391 ns/iter 0.97
JSON_Parse_1 23756.347518336333 ns/iter 24693.798362859263 ns/iter 0.96
JSON_Fast_Hash_Helm_Chart_Lock 24.1694599777584 ns/iter 25.03307415598048 ns/iter 0.97
JSON_Equality_Helm_Chart_Lock 117.31860162383403 ns/iter 115.26095567233268 ns/iter 1.02
JSON_String_Equal/10 5.473636648971177 ns/iter 5.731514759320953 ns/iter 0.96
JSON_String_Equal/100 5.188212062413464 ns/iter 5.388280203699465 ns/iter 0.96
JSON_String_Equal_Small_By_Perfect_Hash/10 0.7898078360426599 ns/iter 0.7980466321769818 ns/iter 0.99
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.545575081583717 ns/iter 3.6832605596617825 ns/iter 0.96
JSON_String_Fast_Hash/10 1.9099121287408496 ns/iter 2.0064032893593007 ns/iter 0.95
JSON_String_Fast_Hash/100 1.9557110075383721 ns/iter 2.010289025430344 ns/iter 0.97
JSON_String_Key_Hash/10 1.4553885999285925 ns/iter 1.513614167683686 ns/iter 0.96
JSON_String_Key_Hash/100 1.9533631137526561 ns/iter 2.042332663526145 ns/iter 0.96
JSON_Object_Defines_Miss_Same_Length 1.74894356382641 ns/iter 1.8292481648725025 ns/iter 0.96
JSON_Object_Defines_Miss_Too_Small 1.9822698964208623 ns/iter 1.9719313587158782 ns/iter 1.01
JSON_Object_Defines_Miss_Too_Large 1.7443362878853 ns/iter 1.825462084356106 ns/iter 0.96
Pointer_Object_Traverse 55.218236190779976 ns/iter 53.88653875246315 ns/iter 1.02
Pointer_Object_Try_Traverse 37.16457268837657 ns/iter 36.72155738320954 ns/iter 1.01
Pointer_Push_Back_Pointer_To_Weak_Pointer 158.55692036838727 ns/iter 161.97287400418261 ns/iter 0.98
Schema_Frame_OMC_Instances 171758711.3380432 ns/iter 176414966.58325195 ns/iter 0.97
Schema_Frame_OMC_References 106717450.27814592 ns/iter 107088168.46211751 ns/iter 1.00
Schema_Frame_OMC_Locations 101991994.04035296 ns/iter 100919553.21175711 ns/iter 1.01
Schema_Bundle_Meta_2020_12 4791127.310858833 ns/iter 4812681.75605203 ns/iter 1.00

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

Please sign in to comment.