Skip to content

Commit

Permalink
Revise Pointer and YAML public interfaces (#1498)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti authored Jan 28, 2025
1 parent 11a33a9 commit d1039b8
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace sourcemeta::core {
/// #include <cassert>
///
/// const auto input{"{\n \"foo\": \"bar\"\n}"};;
/// sourcemeta::core::PositionTracker tracker;
/// sourcemeta::core::PointerPositionTracker tracker;
/// sourcemeta::core::parse_json(stream, std::ref(tracker));
/// assert(tracker.size() == 2);
/// const auto foo{tracker.get(sourcemeta::core::Pointer{"foo"})};
Expand All @@ -41,7 +41,7 @@ namespace sourcemeta::core {
/// assert(std::get<3>(foo.value()) == 2);
/// assert(std::get<4>(foo.value()) == 14);
/// ```
class SOURCEMETA_CORE_JSONPOINTER_EXPORT PositionTracker {
class SOURCEMETA_CORE_JSONPOINTER_EXPORT PointerPositionTracker {
public:
using Pointer = GenericPointer<JSON::String, PropertyHashJSON<JSON::String>>;
using Position =
Expand Down
15 changes: 9 additions & 6 deletions src/core/jsonpointer/position.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

namespace sourcemeta::core {

auto PositionTracker::operator()(const JSON::ParsePhase phase, const JSON::Type,
const std::uint64_t line,
const std::uint64_t column, const JSON &value)
-> void {
auto PointerPositionTracker::operator()(const JSON::ParsePhase phase,
const JSON::Type,
const std::uint64_t line,
const std::uint64_t column,
const JSON &value) -> void {
if (phase == JSON::ParsePhase::Pre) {
this->stack.push({line, column});
if (value.is_string()) {
Expand All @@ -28,13 +29,15 @@ auto PositionTracker::operator()(const JSON::ParsePhase phase, const JSON::Type,
}
}

auto PositionTracker::get(const Pointer &pointer) const
auto PointerPositionTracker::get(const Pointer &pointer) const
-> std::optional<Position> {
const auto result{this->data.find(pointer)};
return result == this->data.cend() ? std::nullopt
: std::optional<Position>{result->second};
}

auto PositionTracker::size() const -> std::size_t { return this->data.size(); }
auto PointerPositionTracker::size() const -> std::size_t {
return this->data.size();
}

} // namespace sourcemeta::core
8 changes: 4 additions & 4 deletions src/core/yaml/include/sourcemeta/core/yaml.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ namespace sourcemeta::core {
///
/// const std::string input{"hello: world"};
/// const sourcemeta::core::JSON document =
/// sourcemeta::core::from_yaml(input);
/// sourcemeta::core::parse_yaml(input);
/// sourcemeta::core::prettify(document, std::cerr);
/// std::cerr << "\n";
/// ```
SOURCEMETA_CORE_YAML_EXPORT
auto from_yaml(const JSON::String &input) -> JSON;
auto parse_yaml(const JSON::String &input) -> JSON;

/// @ingroup yaml
///
Expand All @@ -56,12 +56,12 @@ auto from_yaml(const JSON::String &input) -> JSON;
///
/// const std::filesystem::path path{"test.yaml"};
/// const sourcemeta::core::JSON document =
/// sourcemeta::core::from_yaml(path);
/// sourcemeta::core::read_yaml(path);
/// sourcemeta::core::prettify(document, std::cerr);
/// std::cerr << "\n";
/// ```
SOURCEMETA_CORE_YAML_EXPORT
auto from_yaml(const std::filesystem::path &path) -> JSON;
auto read_yaml(const std::filesystem::path &path) -> JSON;

} // namespace sourcemeta::core

Expand Down
6 changes: 3 additions & 3 deletions src/core/yaml/yaml.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static auto internal_parse_json(yaml_parser_t *parser)

namespace sourcemeta::core {

auto from_yaml(const JSON::String &input) -> JSON {
auto parse_yaml(const JSON::String &input) -> JSON {
yaml_parser_t parser;
if (!yaml_parser_initialize(&parser)) {
throw YAMLError("Could not initialize the YAML parser");
Expand All @@ -112,11 +112,11 @@ auto from_yaml(const JSON::String &input) -> JSON {
}
}

auto from_yaml(const std::filesystem::path &path) -> JSON {
auto read_yaml(const std::filesystem::path &path) -> JSON {
auto stream = read_file(path);
std::ostringstream buffer;
buffer << stream.rdbuf();
return from_yaml(buffer.str());
return parse_yaml(buffer.str());
}

} // namespace sourcemeta::core
10 changes: 5 additions & 5 deletions test/jsonpointer/jsonpointer_position_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ TEST(JSONPointer_position, track_1) {
}
])JSON"};

sourcemeta::core::PositionTracker tracker;
sourcemeta::core::PointerPositionTracker tracker;
sourcemeta::core::parse_json(input, std::ref(tracker));

EXPECT_EQ(tracker.size(), 4);

sourcemeta::core::Pointer pointer_1;
EXPECT_TRUE(tracker.get(pointer_1).has_value());
EXPECT_EQ(tracker.get(pointer_1).value(),
sourcemeta::core::PositionTracker::Position({1, 1, 7, 1}));
sourcemeta::core::PointerPositionTracker::Position({1, 1, 7, 1}));

sourcemeta::core::Pointer pointer_2{0};
EXPECT_TRUE(tracker.get(pointer_2).has_value());
EXPECT_EQ(tracker.get(pointer_2).value(),
sourcemeta::core::PositionTracker::Position({2, 3, 6, 3}));
sourcemeta::core::PointerPositionTracker::Position({2, 3, 6, 3}));

sourcemeta::core::Pointer pointer_3{0, "foo"};
EXPECT_TRUE(tracker.get(pointer_3).has_value());
EXPECT_EQ(tracker.get(pointer_3).value(),
sourcemeta::core::PositionTracker::Position({3, 12, 5, 5}));
sourcemeta::core::PointerPositionTracker::Position({3, 12, 5, 5}));

sourcemeta::core::Pointer pointer_4{0, "foo", "bar"};
EXPECT_TRUE(tracker.get(pointer_4).has_value());
EXPECT_EQ(tracker.get(pointer_4).value(),
sourcemeta::core::PositionTracker::Position({4, 14, 4, 14}));
sourcemeta::core::PointerPositionTracker::Position({4, 14, 4, 14}));
}
18 changes: 9 additions & 9 deletions test/yaml/yaml_parse_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

TEST(YAML_parse, scalar_1) {
const std::string input{"1"};
const auto result{sourcemeta::core::from_yaml(input)};
const auto result{sourcemeta::core::parse_yaml(input)};
const sourcemeta::core::JSON expected{1};
EXPECT_EQ(result, expected);
}

TEST(YAML_parse, object_1) {
const std::string input{"hello: world\nfoo: 1\nbar: true"};

const auto result{sourcemeta::core::from_yaml(input)};
const auto result{sourcemeta::core::parse_yaml(input)};

const sourcemeta::core::JSON expected = sourcemeta::core::parse_json(R"JSON({
"hello": "world",
Expand All @@ -27,7 +27,7 @@ TEST(YAML_parse, object_1) {
TEST(YAML_parse, object_2) {
const std::string input{"foo: >\n bar\n baz"};

const auto result{sourcemeta::core::from_yaml(input)};
const auto result{sourcemeta::core::parse_yaml(input)};

const sourcemeta::core::JSON expected = sourcemeta::core::parse_json(R"JSON({
"foo": "bar baz"
Expand All @@ -39,7 +39,7 @@ TEST(YAML_parse, object_2) {
TEST(YAML_parse, array_1) {
const std::string input{"- foo\n- true"};

const auto result{sourcemeta::core::from_yaml(input)};
const auto result{sourcemeta::core::parse_yaml(input)};

const sourcemeta::core::JSON expected =
sourcemeta::core::parse_json(R"JSON([ "foo", true ])JSON");
Expand All @@ -49,24 +49,24 @@ TEST(YAML_parse, array_1) {

TEST(YAML_parse, empty) {
const std::string input{""};
EXPECT_THROW(sourcemeta::core::from_yaml(input),
EXPECT_THROW(sourcemeta::core::parse_yaml(input),
sourcemeta::core::YAMLParseError);
}

TEST(YAML_parse, blank) {
const std::string input{" "};
EXPECT_THROW(sourcemeta::core::from_yaml(input),
EXPECT_THROW(sourcemeta::core::parse_yaml(input),
sourcemeta::core::YAMLParseError);
}

TEST(YAML_parse, invalid_1) {
const std::string input{"{ xx"};
EXPECT_THROW(sourcemeta::core::from_yaml(input),
EXPECT_THROW(sourcemeta::core::parse_yaml(input),
sourcemeta::core::YAMLParseError);
}

TEST(YAML_parse, stub_test_1) {
const auto result{sourcemeta::core::from_yaml(
const auto result{sourcemeta::core::read_yaml(
std::filesystem::path{STUBS_PATH} / "test_1.yaml")};
const sourcemeta::core::JSON expected = sourcemeta::core::parse_json(R"JSON({
"foo": "bar",
Expand All @@ -77,7 +77,7 @@ TEST(YAML_parse, stub_test_1) {
}

TEST(YAML_parse, file_not_exists) {
EXPECT_THROW(sourcemeta::core::from_yaml(std::filesystem::path{STUBS_PATH} /
EXPECT_THROW(sourcemeta::core::read_yaml(std::filesystem::path{STUBS_PATH} /
"not_exists.yaml"),
std::filesystem::filesystem_error);
}

5 comments on commit d1039b8

@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: d1039b8 Previous: 11a33a9 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.220547577887335 ns/iter 2.2807808245183803 ns/iter 0.97
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.247716283883405 ns/iter 2.221557165399618 ns/iter 1.01
Regex_Period_Asterisk 2.1938147842379876 ns/iter 2.2191893553347626 ns/iter 0.99
Regex_Group_Period_Asterisk_Group 2.201862442030673 ns/iter 2.1994656302916735 ns/iter 1.00
Regex_Period_Plus 2.7996738933152243 ns/iter 2.7987753106338396 ns/iter 1.00
Regex_Period 2.4903684541568527 ns/iter 2.798308478299979 ns/iter 0.89
Regex_Caret_Period_Plus_Dollar 2.716484945499371 ns/iter 2.7982167929019197 ns/iter 0.97
Regex_Caret_Group_Period_Plus_Group_Dollar 2.488667385071972 ns/iter 2.8002324135062695 ns/iter 0.89
Regex_Caret_Period_Asterisk_Dollar 2.2142646830124773 ns/iter 3.419790248577038 ns/iter 0.65
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.193481996152133 ns/iter 3.4193372720644657 ns/iter 0.64
Regex_Caret_X_Hyphen 13.055306126903075 ns/iter 13.068842961291075 ns/iter 1.00
Regex_Period_Md_Dollar 81.58166798897486 ns/iter 81.57622794228904 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 5.603774699785185 ns/iter 6.906041716414757 ns/iter 0.81
Regex_Caret_Period_Range_Dollar 2.8098367183450117 ns/iter 3.1988594614279253 ns/iter 0.88
Regex_Nested_Backtrack 502.30239899997287 ns/iter 498.8224675494191 ns/iter 1.01
JSON_Array_Of_Objects_Unique 405.55829657041426 ns/iter 393.77675461475536 ns/iter 1.03
JSON_Parse_1 30596.74519791165 ns/iter 30342.110026772396 ns/iter 1.01
JSON_Fast_Hash_Helm_Chart_Lock 59.094997287242684 ns/iter 59.349495702311664 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 151.4245138405844 ns/iter 160.6295372889585 ns/iter 0.94
JSON_String_Equal/10 6.222737949466636 ns/iter 6.1222407548890345 ns/iter 1.02
JSON_String_Equal/100 6.848925336962325 ns/iter 6.528766554882213 ns/iter 1.05
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9350277429330012 ns/iter 0.9341422097778194 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.60095197943798 ns/iter 10.810776138935813 ns/iter 1.35
JSON_String_Fast_Hash/10 2.4859153100512303 ns/iter 2.4868043705189415 ns/iter 1.00
JSON_String_Fast_Hash/100 2.486031064618272 ns/iter 2.4851975770456836 ns/iter 1.00
JSON_String_Key_Hash/10 2.654999142447869 ns/iter 2.1773075927702035 ns/iter 1.22
JSON_String_Key_Hash/100 1.8666477267403727 ns/iter 1.866522211366547 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.733899622256243 ns/iter 3.73248016178213 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.7334115510541594 ns/iter 3.73470404911357 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.736346402134831 ns/iter 3.732980224981921 ns/iter 1.00
Pointer_Object_Traverse 44.29840964830761 ns/iter 44.47817152719941 ns/iter 1.00
Pointer_Object_Try_Traverse 52.37492310502513 ns/iter 52.40706450334246 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 306.90642949558656 ns/iter 301.8532897197501 ns/iter 1.02

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: d1039b8 Previous: 11a33a9 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.272603659912782 ns/iter 2.116681058480461 ns/iter 1.07
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.292447019131944 ns/iter 1.7736099918214527 ns/iter 1.29
Regex_Period_Asterisk 2.13597649445663 ns/iter 1.7444086660931577 ns/iter 1.22
Regex_Group_Period_Asterisk_Group 2.5155558253371537 ns/iter 1.8582800667293007 ns/iter 1.35
Regex_Period_Plus 2.9661443190639707 ns/iter 2.5604757934042426 ns/iter 1.16
Regex_Period 2.9591032337633196 ns/iter 2.38863893790297 ns/iter 1.24
Regex_Caret_Period_Plus_Dollar 2.649880218102814 ns/iter 2.1412191002759196 ns/iter 1.24
Regex_Caret_Group_Period_Plus_Group_Dollar 2.899119408415247 ns/iter 2.031754372466838 ns/iter 1.43
Regex_Caret_Period_Asterisk_Dollar 2.588812324057509 ns/iter 1.7061892441467585 ns/iter 1.52
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.264736107438064 ns/iter 1.699064495733761 ns/iter 1.33
Regex_Caret_X_Hyphen 9.098641882491895 ns/iter 7.220669999246519 ns/iter 1.26
Regex_Period_Md_Dollar 100.8998583489317 ns/iter 74.59936204315419 ns/iter 1.35
Regex_Caret_Slash_Period_Asterisk 6.378184644628103 ns/iter 5.5818021686504276 ns/iter 1.14
Regex_Caret_Period_Range_Dollar 3.1395645799794774 ns/iter 2.4039329240168885 ns/iter 1.31
Regex_Nested_Backtrack 1047.9826508778744 ns/iter 794.018258601869 ns/iter 1.32
JSON_Array_Of_Objects_Unique 440.1934757700168 ns/iter 364.73191988073086 ns/iter 1.21
JSON_Parse_1 30284.62411968264 ns/iter 23444.95783667393 ns/iter 1.29
JSON_Fast_Hash_Helm_Chart_Lock 63.99578752276005 ns/iter 54.31572214370856 ns/iter 1.18
JSON_Equality_Helm_Chart_Lock 155.923992024792 ns/iter 135.93192103175582 ns/iter 1.15
JSON_String_Equal/10 10.56912447437271 ns/iter 8.25028442961671 ns/iter 1.28
JSON_String_Equal/100 9.364821301284968 ns/iter 6.712316225727439 ns/iter 1.40
JSON_String_Equal_Small_By_Perfect_Hash/10 0.41239453396608233 ns/iter 0.3413935109351046 ns/iter 1.21
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.8704953860071933 ns/iter 3.1936554959815058 ns/iter 1.21
JSON_String_Fast_Hash/10 2.057935356450222 ns/iter 1.7899087917700789 ns/iter 1.15
JSON_String_Fast_Hash/100 2.4879413451627133 ns/iter 2.0813058370555684 ns/iter 1.20
JSON_String_Key_Hash/10 1.5778325125852966 ns/iter 1.3658070510356177 ns/iter 1.16
JSON_String_Key_Hash/100 1.6773218966140813 ns/iter 1.3676967869786802 ns/iter 1.23
JSON_Object_Defines_Miss_Same_Length 2.7513182587675784 ns/iter 2.379236223483284 ns/iter 1.16
JSON_Object_Defines_Miss_Too_Small 2.7463315990630255 ns/iter 2.3779830499208705 ns/iter 1.15
JSON_Object_Defines_Miss_Too_Large 2.815601865018342 ns/iter 2.3685362230764113 ns/iter 1.19
Pointer_Object_Traverse 22.383229344936808 ns/iter 18.26172252115055 ns/iter 1.23
Pointer_Object_Try_Traverse 34.39778225139049 ns/iter 23.68588144455477 ns/iter 1.45
Pointer_Push_Back_Pointer_To_Weak_Pointer 232.2348523741067 ns/iter 180.05261467732967 ns/iter 1.29

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: d1039b8 Previous: 11a33a9 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 6.8718649553569024 ns/iter 6.844563616071094 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 6.8636571428574 ns/iter 6.970795758926482 ns/iter 0.98
Regex_Period_Asterisk 6.974486607142743 ns/iter 6.900215401784188 ns/iter 1.01
Regex_Group_Period_Asterisk_Group 6.988375000000095 ns/iter 6.878539062500672 ns/iter 1.02
Regex_Period_Plus 7.226108258928982 ns/iter 7.456861607142429 ns/iter 0.97
Regex_Period 7.387556919643703 ns/iter 7.3951149553559095 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 7.135473214286188 ns/iter 7.171933035713554 ns/iter 0.99
Regex_Caret_Group_Period_Plus_Group_Dollar 7.253243303571974 ns/iter 7.305022321428823 ns/iter 0.99
Regex_Caret_Period_Asterisk_Dollar 6.996428571428887 ns/iter 7.04188657570672 ns/iter 0.99
Regex_Caret_Group_Period_Asterisk_Group_Dollar 6.98299553571502 ns/iter 6.845764508927996 ns/iter 1.02
Regex_Caret_X_Hyphen 14.227035204343391 ns/iter 14.254191900652053 ns/iter 1.00
Regex_Period_Md_Dollar 150.2891071428536 ns/iter 151.10101334369136 ns/iter 0.99
Regex_Caret_Slash_Period_Asterisk 10.38084687499996 ns/iter 10.584266071426946 ns/iter 0.98
Regex_Caret_Period_Range_Dollar 7.486743716576887 ns/iter 7.53312611607017 ns/iter 0.99
Regex_Nested_Backtrack 608.3369642856796 ns/iter 606.4551000001757 ns/iter 1.00
JSON_Array_Of_Objects_Unique 491.141263845394 ns/iter 497.2141999999167 ns/iter 0.99
JSON_Parse_1 79810.91517857816 ns/iter 81026.23883927049 ns/iter 0.99
JSON_Fast_Hash_Helm_Chart_Lock 66.33134821427689 ns/iter 66.83645535714179 ns/iter 0.99
JSON_Equality_Helm_Chart_Lock 188.36602574697568 ns/iter 187.5144542423164 ns/iter 1.00
JSON_String_Equal/10 8.985188616071735 ns/iter 10.097710937500892 ns/iter 0.89
JSON_String_Equal/100 9.92287897355859 ns/iter 9.93522049136069 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 2.174887500000011 ns/iter 2.171586875000031 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.828819196429167 ns/iter 15.126024553571783 ns/iter 0.98
JSON_String_Fast_Hash/10 4.041466123288193 ns/iter 4.032457819700725 ns/iter 1.00
JSON_String_Fast_Hash/100 4.028135319692967 ns/iter 4.034441406249708 ns/iter 1.00
JSON_String_Key_Hash/10 7.935802196715434 ns/iter 7.8205191615166605 ns/iter 1.01
JSON_String_Key_Hash/100 4.035108310776726 ns/iter 4.026358846474913 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.7559480290077483 ns/iter 3.7171205290754754 ns/iter 1.01
JSON_Object_Defines_Miss_Too_Small 4.967442857143567 ns/iter 4.948376785715628 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.4380607974321817 ns/iter 3.410099067828573 ns/iter 1.01
Pointer_Object_Traverse 49.39659000000347 ns/iter 80.14955357142283 ns/iter 0.62
Pointer_Object_Try_Traverse 67.81262276785834 ns/iter 116.66635937501722 ns/iter 0.58
Pointer_Push_Back_Pointer_To_Weak_Pointer 162.48794642856572 ns/iter 160.55787946430857 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 (linux/gcc)

Benchmark suite Current: d1039b8 Previous: 11a33a9 Ratio
Pointer_Object_Traverse 45.64983324736455 ns/iter 45.16390949323974 ns/iter 1.01
Pointer_Object_Try_Traverse 26.14561696173193 ns/iter 26.111382534973224 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 144.98700164498874 ns/iter 144.9049279761811 ns/iter 1.00
JSON_Array_Of_Objects_Unique 414.4424439435892 ns/iter 432.3543943975185 ns/iter 0.96
JSON_Parse_1 33488.16770838592 ns/iter 33451.40408398043 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 62.86977271866869 ns/iter 62.56616092964772 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 150.91060489094605 ns/iter 150.14916566167022 ns/iter 1.01
JSON_String_Equal/10 6.33749663091924 ns/iter 6.030313865090898 ns/iter 1.05
JSON_String_Equal/100 6.967756830455331 ns/iter 6.657679394850591 ns/iter 1.05
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9336441250683972 ns/iter 0.934618627759943 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.288750528005046 ns/iter 14.288583883154198 ns/iter 1.00
JSON_String_Fast_Hash/10 0.9328878806972629 ns/iter 0.9327954438653635 ns/iter 1.00
JSON_String_Fast_Hash/100 0.9322742114096909 ns/iter 0.9398972460159669 ns/iter 0.99
JSON_String_Key_Hash/10 1.6761272356245651 ns/iter 1.6764196359396297 ns/iter 1.00
JSON_String_Key_Hash/100 1.9835455350792497 ns/iter 1.9901229535658163 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 2.661097417192496 ns/iter 2.5086782802576244 ns/iter 1.06
JSON_Object_Defines_Miss_Too_Small 2.4959629192068467 ns/iter 2.4894920870454817 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.1085096648253177 ns/iter 3.108352550658352 ns/iter 1.00
Regex_Lower_S_Or_Upper_S_Asterisk 3.4198403515840377 ns/iter 3.4227076820488813 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 3.4288885296590075 ns/iter 3.420816557939057 ns/iter 1.00
Regex_Period_Asterisk 3.4215930773693723 ns/iter 3.424576616171009 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 3.4254047160594197 ns/iter 3.420972487445795 ns/iter 1.00
Regex_Period_Plus 3.7345131097394084 ns/iter 3.733946174448897 ns/iter 1.00
Regex_Period 3.7305413376614265 ns/iter 3.7409591857185673 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 3.7342162475184466 ns/iter 3.7308946651251813 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 4.215419201107587 ns/iter 3.7322776100461215 ns/iter 1.13
Regex_Caret_Period_Asterisk_Dollar 4.661344183754675 ns/iter 4.664733973566954 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 4.660717727100717 ns/iter 4.666126075688497 ns/iter 1.00
Regex_Caret_X_Hyphen 13.143488127108597 ns/iter 12.4313248757565 ns/iter 1.06
Regex_Period_Md_Dollar 93.38737598994702 ns/iter 89.85685949284017 ns/iter 1.04
Regex_Caret_Slash_Period_Asterisk 8.08867601860652 ns/iter 8.080048423392693 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 4.68489834175964 ns/iter 4.663130342025331 ns/iter 1.00
Regex_Nested_Backtrack 823.6360329232282 ns/iter 940.5691427652416 ns/iter 0.88

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: d1039b8 Previous: 11a33a9 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.4195720697651444 ns/iter 2.196760277209099 ns/iter 1.10
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.3174542852993736 ns/iter 2.2322388629451297 ns/iter 1.04
Regex_Period_Asterisk 2.34573295774675 ns/iter 2.3215049687761944 ns/iter 1.01
Regex_Group_Period_Asterisk_Group 2.392394755450172 ns/iter 2.3500710499001016 ns/iter 1.02
Regex_Period_Plus 1.9970364152816449 ns/iter 2.0218266456797207 ns/iter 0.99
Regex_Period 2.0219891210105225 ns/iter 2.1037899700310523 ns/iter 0.96
Regex_Caret_Period_Plus_Dollar 1.9939159830868136 ns/iter 2.0174590362279674 ns/iter 0.99
Regex_Caret_Group_Period_Plus_Group_Dollar 2.1077153542634384 ns/iter 2.0201504749374 ns/iter 1.04
Regex_Caret_Period_Asterisk_Dollar 2.353490441479331 ns/iter 2.323303586173808 ns/iter 1.01
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.682683548533442 ns/iter 2.643869943396479 ns/iter 1.01
Regex_Caret_X_Hyphen 6.906095276325223 ns/iter 6.876340459185298 ns/iter 1.00
Regex_Period_Md_Dollar 73.29214143605276 ns/iter 74.9346184043941 ns/iter 0.98
Regex_Caret_Slash_Period_Asterisk 5.11486335625981 ns/iter 5.138597757528322 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 2.3275476075501382 ns/iter 2.533402868271604 ns/iter 0.92
Regex_Nested_Backtrack 867.4661879869855 ns/iter 912.6251609121055 ns/iter 0.95
JSON_Array_Of_Objects_Unique 213.24683500663022 ns/iter 220.5396592765276 ns/iter 0.97
JSON_Parse_1 24996.58601164034 ns/iter 29117.145683620212 ns/iter 0.86
JSON_Fast_Hash_Helm_Chart_Lock 25.106959900570214 ns/iter 26.933432085760153 ns/iter 0.93
JSON_Equality_Helm_Chart_Lock 121.97786776868148 ns/iter 126.15392027961005 ns/iter 0.97
JSON_String_Equal/10 5.758435847668455 ns/iter 6.533409925520619 ns/iter 0.88
JSON_String_Equal/100 5.486693152532578 ns/iter 5.4464437338623455 ns/iter 1.01
JSON_String_Equal_Small_By_Perfect_Hash/10 0.797841942657607 ns/iter 0.8209938713791164 ns/iter 0.97
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.7041075376409105 ns/iter 3.713139426758567 ns/iter 1.00
JSON_String_Fast_Hash/10 2.0221980617441124 ns/iter 2.079401748237526 ns/iter 0.97
JSON_String_Fast_Hash/100 2.023561221865578 ns/iter 2.0781193187743954 ns/iter 0.97
JSON_String_Key_Hash/10 1.5005616754259958 ns/iter 1.5504810253478103 ns/iter 0.97
JSON_String_Key_Hash/100 2.069351140277079 ns/iter 2.069647201336622 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 1.8334778564425385 ns/iter 1.8472640281530048 ns/iter 0.99
JSON_Object_Defines_Miss_Too_Small 2.0728651951016746 ns/iter 2.044030207526412 ns/iter 1.01
JSON_Object_Defines_Miss_Too_Large 1.876194814754322 ns/iter 1.854803647292833 ns/iter 1.01
Pointer_Object_Traverse 59.14382191972436 ns/iter 58.92435510813561 ns/iter 1.00
Pointer_Object_Try_Traverse 38.44343493689406 ns/iter 38.5514895762365 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 186.46083669995804 ns/iter 163.53684220010373 ns/iter 1.14

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

Please sign in to comment.