Skip to content

Commit

Permalink
Detect unresolved fragments when bundling (#1416)
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 2, 2025
1 parent 438dac1 commit 6667b99
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 108 deletions.
20 changes: 17 additions & 3 deletions src/jsonschema/bundle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ auto bundle_schema(sourcemeta::jsontoolkit::JSON &root,
const std::string &container,
const sourcemeta::jsontoolkit::JSON &subschema,
sourcemeta::jsontoolkit::FrameLocations &frame,
sourcemeta::jsontoolkit::FrameReferences &references,
const sourcemeta::jsontoolkit::SchemaWalker &walker,
const sourcemeta::jsontoolkit::SchemaResolver &resolver,
const std::optional<std::string> &default_dialect) -> void {
sourcemeta::jsontoolkit::FrameReferences references;
sourcemeta::jsontoolkit::frame(subschema, frame, references, walker, resolver,
default_dialect);

Expand All @@ -72,6 +72,19 @@ auto bundle_schema(sourcemeta::jsontoolkit::JSON &root,
continue;
}

// If we can't find the destination but there is a base and we can
// find base, then we are facing an unresolved fragment
if (reference.base.has_value()) {
if (frame.contains({sourcemeta::jsontoolkit::ReferenceType::Static,
reference.base.value()}) ||
frame.contains({sourcemeta::jsontoolkit::ReferenceType::Dynamic,
reference.base.value()})) {
throw sourcemeta::jsontoolkit::SchemaReferenceError(
reference.destination, key.second,
"Could not resolve schema reference");
}
}

root.assign_if_missing(container,
sourcemeta::jsontoolkit::JSON::make_object());

Expand Down Expand Up @@ -121,7 +134,7 @@ auto bundle_schema(sourcemeta::jsontoolkit::JSON &root,
}

embed_schema(root.at(container), identifier, copy);
bundle_schema(root, container, copy, frame, walker, resolver,
bundle_schema(root, container, copy, frame, references, walker, resolver,
default_dialect);
}
}
Expand Down Expand Up @@ -197,8 +210,9 @@ auto bundle(sourcemeta::jsontoolkit::JSON &schema, const SchemaWalker &walker,
const auto vocabularies{
sourcemeta::jsontoolkit::vocabularies(schema, resolver, default_dialect)};
sourcemeta::jsontoolkit::FrameLocations frame;
sourcemeta::jsontoolkit::FrameReferences references;
bundle_schema(schema, definitions_keyword(vocabularies), schema, frame,
walker, resolver, default_dialect);
references, walker, resolver, default_dialect);

if (options == BundleOptions::WithoutIdentifiers) {
remove_identifiers(schema, walker, resolver, default_dialect);
Expand Down
39 changes: 21 additions & 18 deletions src/jsonschema/frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,11 @@ auto sourcemeta::jsontoolkit::frame(
metaschema.canonicalize();
const std::string destination{metaschema.recompose()};
assert(entry.common.value.defines("$schema"));
references.insert(
{{ReferenceType::Static, entry.common.pointer.concat({"$schema"})},
{destination, metaschema.recompose_without_fragment(),
fragment_string(metaschema)}});
references.insert_or_assign(
{ReferenceType::Static, entry.common.pointer.concat({"$schema"})},
FrameReferencesEntry{destination,
metaschema.recompose_without_fragment(),
fragment_string(metaschema)});
}

// Handle schema anchors
Expand Down Expand Up @@ -423,10 +424,11 @@ auto sourcemeta::jsontoolkit::frame(
}

ref.canonicalize();
references.insert(
{{ReferenceType::Static, entry.common.pointer.concat({"$ref"})},
{ref.recompose(), ref.recompose_without_fragment(),
fragment_string(ref)}});
references.insert_or_assign(
{ReferenceType::Static, entry.common.pointer.concat({"$ref"})},
FrameReferencesEntry{ref.recompose(),
ref.recompose_without_fragment(),
fragment_string(ref)});
}

if (entry.common.vocabularies.contains(
Expand Down Expand Up @@ -454,10 +456,11 @@ auto sourcemeta::jsontoolkit::frame(
: ReferenceType::Dynamic};
const sourcemeta::jsontoolkit::URI anchor_uri{
std::move(anchor_uri_string)};
references.insert(
{{reference_type, entry.common.pointer.concat({"$recursiveRef"})},
{anchor_uri.recompose(), anchor_uri.recompose_without_fragment(),
fragment_string(anchor_uri)}});
references.insert_or_assign(
{reference_type, entry.common.pointer.concat({"$recursiveRef"})},
FrameReferencesEntry{anchor_uri.recompose(),
anchor_uri.recompose_without_fragment(),
fragment_string(anchor_uri)});
}

if (entry.common.vocabularies.contains(
Expand Down Expand Up @@ -486,12 +489,12 @@ auto sourcemeta::jsontoolkit::frame(
(has_fragment &&
maybe_static_frame != frame.end() &&
maybe_dynamic_frame == frame.end())};
references.insert(
{{behaves_as_static ? ReferenceType::Static
: ReferenceType::Dynamic,
entry.common.pointer.concat({"$dynamicRef"})},
{std::move(ref_string), ref.recompose_without_fragment(),
fragment_string(ref)}});
references.insert_or_assign(
{behaves_as_static ? ReferenceType::Static : ReferenceType::Dynamic,
entry.common.pointer.concat({"$dynamicRef"})},
FrameReferencesEntry{std::move(ref_string),
ref.recompose_without_fragment(),
fragment_string(ref)});
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions test/jsonschema/jsonschema_bundle_2020_12_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,22 @@ TEST(JSONSchema_bundle_2020_12, schema_not_found) {
sourcemeta::jsontoolkit::SchemaResolutionError);
}

TEST(JSONSchema_bundle_2020_12, anchor_not_found) {
sourcemeta::jsontoolkit::JSON document =
sourcemeta::jsontoolkit::parse(R"JSON({
"$id": "https://example.com",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": { "$ref": "https://example.com/foo/bar#xxxxxxxx" }
}
})JSON");

EXPECT_THROW(sourcemeta::jsontoolkit::bundle(
document, sourcemeta::jsontoolkit::default_schema_walker,
test_resolver),
sourcemeta::jsontoolkit::SchemaReferenceError);
}

TEST(JSONSchema_bundle_2020_12, idempotency) {
sourcemeta::jsontoolkit::JSON document =
sourcemeta::jsontoolkit::parse(R"JSON({
Expand Down
34 changes: 5 additions & 29 deletions test/jsonschema/jsonschema_bundle_draft4_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@

static auto test_resolver(std::string_view identifier)
-> std::optional<sourcemeta::jsontoolkit::JSON> {
if (identifier == "https://example.com/foo/bar") {
return sourcemeta::jsontoolkit::parse(R"JSON({
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "https://example.com/foo/bar",
"$anchor": "baz"
})JSON");
} else if (identifier == "https://www.sourcemeta.com/test-1") {
if (identifier == "https://www.sourcemeta.com/test-1") {
return sourcemeta::jsontoolkit::parse(R"JSON({
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "https://www.sourcemeta.com/test-1",
Expand Down Expand Up @@ -118,9 +112,7 @@ TEST(JSONSchema_bundle_draft4, simple_with_id) {
"bar": {
"id": "https://www.sourcemeta.com",
"allOf": [ { "$ref": "test-2" } ]
},
"baz": { "$ref": "https://example.com/foo/bar#baz" },
"qux": { "$ref": "https://example.com/foo/bar" }
}
}
})JSON");

Expand All @@ -136,9 +128,7 @@ TEST(JSONSchema_bundle_draft4, simple_with_id) {
"bar": {
"id": "https://www.sourcemeta.com",
"allOf": [ { "$ref": "test-2" } ]
},
"baz": { "$ref": "https://example.com/foo/bar#baz" },
"qux": { "$ref": "https://example.com/foo/bar" }
}
},
"definitions": {
"https://www.sourcemeta.com/test-1": {
Expand All @@ -155,11 +145,6 @@ TEST(JSONSchema_bundle_draft4, simple_with_id) {
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "https://www.sourcemeta.com/test-3",
"allOf": [ { "$ref": "test-1" } ]
},
"https://example.com/foo/bar": {
"id": "https://example.com/foo/bar",
"$schema": "http://json-schema.org/draft-04/schema#",
"$anchor": "baz"
}
}
})JSON");
Expand All @@ -176,9 +161,7 @@ TEST(JSONSchema_bundle_draft4, simple_without_id) {
"bar": {
"id": "https://www.sourcemeta.com",
"allOf": [ { "$ref": "test-2" } ]
},
"baz": { "$ref": "https://example.com/foo/bar#baz" },
"qux": { "$ref": "https://example.com/foo/bar" }
}
}
})JSON");

Expand All @@ -193,9 +176,7 @@ TEST(JSONSchema_bundle_draft4, simple_without_id) {
"bar": {
"id": "https://www.sourcemeta.com",
"allOf": [ { "$ref": "test-2" } ]
},
"baz": { "$ref": "https://example.com/foo/bar#baz" },
"qux": { "$ref": "https://example.com/foo/bar" }
}
},
"definitions": {
"https://www.sourcemeta.com/test-1": {
Expand All @@ -212,11 +193,6 @@ TEST(JSONSchema_bundle_draft4, simple_without_id) {
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "https://www.sourcemeta.com/test-3",
"allOf": [ { "$ref": "test-1" } ]
},
"https://example.com/foo/bar": {
"id": "https://example.com/foo/bar",
"$schema": "http://json-schema.org/draft-04/schema#",
"$anchor": "baz"
}
}
})JSON");
Expand Down
34 changes: 5 additions & 29 deletions test/jsonschema/jsonschema_bundle_draft6_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@

static auto test_resolver(std::string_view identifier)
-> std::optional<sourcemeta::jsontoolkit::JSON> {
if (identifier == "https://example.com/foo/bar") {
return sourcemeta::jsontoolkit::parse(R"JSON({
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://example.com/foo/bar",
"$anchor": "baz"
})JSON");
} else if (identifier == "https://www.sourcemeta.com/test-1") {
if (identifier == "https://www.sourcemeta.com/test-1") {
return sourcemeta::jsontoolkit::parse(R"JSON({
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://www.sourcemeta.com/test-1",
Expand Down Expand Up @@ -118,9 +112,7 @@ TEST(JSONSchema_bundle_draft6, simple_with_id) {
"bar": {
"$id": "https://www.sourcemeta.com",
"allOf": [ { "$ref": "test-2" } ]
},
"baz": { "$ref": "https://example.com/foo/bar#baz" },
"qux": { "$ref": "https://example.com/foo/bar" }
}
}
})JSON");

Expand All @@ -136,9 +128,7 @@ TEST(JSONSchema_bundle_draft6, simple_with_id) {
"bar": {
"$id": "https://www.sourcemeta.com",
"allOf": [ { "$ref": "test-2" } ]
},
"baz": { "$ref": "https://example.com/foo/bar#baz" },
"qux": { "$ref": "https://example.com/foo/bar" }
}
},
"definitions": {
"https://www.sourcemeta.com/test-1": {
Expand All @@ -155,11 +145,6 @@ TEST(JSONSchema_bundle_draft6, simple_with_id) {
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://www.sourcemeta.com/test-3",
"allOf": [ { "$ref": "test-1" } ]
},
"https://example.com/foo/bar": {
"$id": "https://example.com/foo/bar",
"$schema": "http://json-schema.org/draft-06/schema#",
"$anchor": "baz"
}
}
})JSON");
Expand All @@ -176,9 +161,7 @@ TEST(JSONSchema_bundle_draft6, simple_without_id) {
"bar": {
"$id": "https://www.sourcemeta.com",
"allOf": [ { "$ref": "test-2" } ]
},
"baz": { "$ref": "https://example.com/foo/bar#baz" },
"qux": { "$ref": "https://example.com/foo/bar" }
}
}
})JSON");

Expand All @@ -193,9 +176,7 @@ TEST(JSONSchema_bundle_draft6, simple_without_id) {
"bar": {
"$id": "https://www.sourcemeta.com",
"allOf": [ { "$ref": "test-2" } ]
},
"baz": { "$ref": "https://example.com/foo/bar#baz" },
"qux": { "$ref": "https://example.com/foo/bar" }
}
},
"definitions": {
"https://www.sourcemeta.com/test-1": {
Expand All @@ -212,11 +193,6 @@ TEST(JSONSchema_bundle_draft6, simple_without_id) {
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://www.sourcemeta.com/test-3",
"allOf": [ { "$ref": "test-1" } ]
},
"https://example.com/foo/bar": {
"$id": "https://example.com/foo/bar",
"$schema": "http://json-schema.org/draft-06/schema#",
"$anchor": "baz"
}
}
})JSON");
Expand Down
34 changes: 5 additions & 29 deletions test/jsonschema/jsonschema_bundle_draft7_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@

static auto test_resolver(std::string_view identifier)
-> std::optional<sourcemeta::jsontoolkit::JSON> {
if (identifier == "https://example.com/foo/bar") {
return sourcemeta::jsontoolkit::parse(R"JSON({
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://example.com/foo/bar",
"$anchor": "baz"
})JSON");
} else if (identifier == "https://www.sourcemeta.com/test-1") {
if (identifier == "https://www.sourcemeta.com/test-1") {
return sourcemeta::jsontoolkit::parse(R"JSON({
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://www.sourcemeta.com/test-1",
Expand Down Expand Up @@ -118,9 +112,7 @@ TEST(JSONSchema_bundle_draft7, simple_with_id) {
"bar": {
"$id": "https://www.sourcemeta.com",
"allOf": [ { "$ref": "test-2" } ]
},
"baz": { "$ref": "https://example.com/foo/bar#baz" },
"qux": { "$ref": "https://example.com/foo/bar" }
}
}
})JSON");

Expand All @@ -136,9 +128,7 @@ TEST(JSONSchema_bundle_draft7, simple_with_id) {
"bar": {
"$id": "https://www.sourcemeta.com",
"allOf": [ { "$ref": "test-2" } ]
},
"baz": { "$ref": "https://example.com/foo/bar#baz" },
"qux": { "$ref": "https://example.com/foo/bar" }
}
},
"definitions": {
"https://www.sourcemeta.com/test-1": {
Expand All @@ -155,11 +145,6 @@ TEST(JSONSchema_bundle_draft7, simple_with_id) {
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://www.sourcemeta.com/test-3",
"allOf": [ { "$ref": "test-1" } ]
},
"https://example.com/foo/bar": {
"$id": "https://example.com/foo/bar",
"$schema": "http://json-schema.org/draft-07/schema#",
"$anchor": "baz"
}
}
})JSON");
Expand All @@ -176,9 +161,7 @@ TEST(JSONSchema_bundle_draft7, simple_without_id) {
"bar": {
"$id": "https://www.sourcemeta.com",
"allOf": [ { "$ref": "test-2" } ]
},
"baz": { "$ref": "https://example.com/foo/bar#baz" },
"qux": { "$ref": "https://example.com/foo/bar" }
}
}
})JSON");

Expand All @@ -193,9 +176,7 @@ TEST(JSONSchema_bundle_draft7, simple_without_id) {
"bar": {
"$id": "https://www.sourcemeta.com",
"allOf": [ { "$ref": "test-2" } ]
},
"baz": { "$ref": "https://example.com/foo/bar#baz" },
"qux": { "$ref": "https://example.com/foo/bar" }
}
},
"definitions": {
"https://www.sourcemeta.com/test-1": {
Expand All @@ -212,11 +193,6 @@ TEST(JSONSchema_bundle_draft7, simple_without_id) {
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://www.sourcemeta.com/test-3",
"allOf": [ { "$ref": "test-1" } ]
},
"https://example.com/foo/bar": {
"$id": "https://example.com/foo/bar",
"$schema": "http://json-schema.org/draft-07/schema#",
"$anchor": "baz"
}
}
})JSON");
Expand Down

4 comments on commit 6667b99

@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: 6667b99 Previous: 438dac1 Ratio
JSON_Array_Of_Objects_Unique 360.64912257468245 ns/iter 331.36949163719066 ns/iter 1.09
JSON_Parse_1 23653.79438115162 ns/iter 21574.801780233043 ns/iter 1.10
JSON_Fast_Hash_Helm_Chart_Lock 51.253201128437176 ns/iter 47.71925351718202 ns/iter 1.07
JSON_Equality_Helm_Chart_Lock 142.69416022857365 ns/iter 143.95291227511257 ns/iter 0.99
Regex_Lower_S_Or_Upper_S_Asterisk 1.6045096805700656 ns/iter 1.5816577167351995 ns/iter 1.01
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.5703066726680281 ns/iter 1.5801637613120254 ns/iter 0.99
Regex_Period_Asterisk 1.5748174212463257 ns/iter 1.57298671740179 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 1.5918576180073154 ns/iter 1.6585182549298974 ns/iter 0.96
Regex_Period_Plus 1.9054647681817847 ns/iter 1.8954434043626176 ns/iter 1.01
Regex_Period 1.992953358258757 ns/iter 1.8960033437034214 ns/iter 1.05
Regex_Caret_Period_Plus_Dollar 1.9959298735298903 ns/iter 1.90851629450462 ns/iter 1.05
Regex_Caret_Group_Period_Plus_Group_Dollar 2.0724836296927553 ns/iter 1.9075741524177925 ns/iter 1.09
Regex_Caret_Period_Asterisk_Dollar 1.788407284719736 ns/iter 1.5864063192316613 ns/iter 1.13
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.666632092376026 ns/iter 1.5913473013692847 ns/iter 1.05
Regex_Caret_X_Hyphen 6.992695347711883 ns/iter 6.454181794960384 ns/iter 1.08
Regex_Period_Md_Dollar 72.75182007613687 ns/iter 72.88089294204418 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 6.992363070129627 ns/iter 6.3871844130223385 ns/iter 1.09
Regex_Caret_Period_Range_Dollar 2.133512529836628 ns/iter 2.1225301399495167 ns/iter 1.01
Regex_Nested_Backtrack 727.012901243631 ns/iter 733.4236687642416 ns/iter 0.99
Pointer_Object_Traverse 14.764054979109073 ns/iter 14.77445398774132 ns/iter 1.00
Pointer_Object_Try_Traverse 31.440202491005927 ns/iter 31.447803360756794 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 173.17992659166924 ns/iter 172.84519714419275 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: 6667b99 Previous: 438dac1 Ratio
JSON_Array_Of_Objects_Unique 432.54453382903506 ns/iter 444.2523323201579 ns/iter 0.97
JSON_Parse_1 30096.75415053666 ns/iter 30107.952405521504 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 60.736773425408636 ns/iter 54.725652876581215 ns/iter 1.11
JSON_Equality_Helm_Chart_Lock 149.5472496677341 ns/iter 146.57854079338574 ns/iter 1.02
Regex_Lower_S_Or_Upper_S_Asterisk 2.2101433633174965 ns/iter 2.2131550633210426 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.209297124408009 ns/iter 2.195345742188674 ns/iter 1.01
Regex_Period_Asterisk 2.213277746606503 ns/iter 2.2041432362018614 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 2.2134752954073185 ns/iter 2.3385434146733877 ns/iter 0.95
Regex_Period_Plus 2.4883742988004802 ns/iter 2.2806082330638633 ns/iter 1.09
Regex_Period 2.2128603211101323 ns/iter 2.269551280346167 ns/iter 0.98
Regex_Caret_Period_Plus_Dollar 2.2173238376929767 ns/iter 2.2674099615906407 ns/iter 0.98
Regex_Caret_Group_Period_Plus_Group_Dollar 2.216469586509374 ns/iter 2.2585738258415673 ns/iter 0.98
Regex_Caret_Period_Asterisk_Dollar 2.385101996143657 ns/iter 2.486708930137886 ns/iter 0.96
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.214756944531751 ns/iter 2.4858083430036 ns/iter 0.89
Regex_Caret_X_Hyphen 13.048791104757349 ns/iter 12.512549659140726 ns/iter 1.04
Regex_Period_Md_Dollar 79.1325106869709 ns/iter 75.93561481460803 ns/iter 1.04
Regex_Caret_Slash_Period_Asterisk 6.221289086708885 ns/iter 7.149377266307775 ns/iter 0.87
Regex_Caret_Period_Range_Dollar 3.733126920909408 ns/iter 3.7303062445930397 ns/iter 1.00
Regex_Nested_Backtrack 500.3022369546572 ns/iter 494.0279222429277 ns/iter 1.01
Pointer_Object_Traverse 44.894431923998305 ns/iter 44.9182358746664 ns/iter 1.00
Pointer_Object_Try_Traverse 52.33582066720902 ns/iter 52.310649877457365 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 380.28636023640075 ns/iter 353.9450992099714 ns/iter 1.07

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: 6667b99 Previous: 438dac1 Ratio
JSON_Array_Of_Objects_Unique 421.4853427908528 ns/iter 421.88404583012175 ns/iter 1.00
JSON_Parse_1 80318.90624999555 ns/iter 81941.86420249271 ns/iter 0.98
JSON_Fast_Hash_Helm_Chart_Lock 55.53470535714057 ns/iter 58.071210000002786 ns/iter 0.96
JSON_Equality_Helm_Chart_Lock 220.66437500001254 ns/iter 219.92556249998074 ns/iter 1.00
Regex_Lower_S_Or_Upper_S_Asterisk 8.444252640874119 ns/iter 8.076851562500867 ns/iter 1.05
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 8.19787228483079 ns/iter 8.271724516644921 ns/iter 0.99
Regex_Period_Asterisk 7.775402643859273 ns/iter 7.8846669290867135 ns/iter 0.99
Regex_Group_Period_Asterisk_Group 7.902271205357485 ns/iter 8.01469419642891 ns/iter 0.99
Regex_Period_Plus 7.948154428802565 ns/iter 7.900162464730765 ns/iter 1.01
Regex_Period 8.023016741072198 ns/iter 7.790800411648236 ns/iter 1.03
Regex_Caret_Period_Plus_Dollar 8.044575892857914 ns/iter 7.757658447511629 ns/iter 1.04
Regex_Caret_Group_Period_Plus_Group_Dollar 8.142361570793573 ns/iter 8.092112723214433 ns/iter 1.01
Regex_Caret_Period_Asterisk_Dollar 8.19105665986122 ns/iter 8.01579575892854 ns/iter 1.02
Regex_Caret_Group_Period_Asterisk_Group_Dollar 7.806166036580585 ns/iter 7.761279017857804 ns/iter 1.01
Regex_Caret_X_Hyphen 11.83149107142713 ns/iter 11.669101785713565 ns/iter 1.01
Regex_Period_Md_Dollar 141.68124999999677 ns/iter 144.67541541628387 ns/iter 0.98
Regex_Caret_Slash_Period_Asterisk 11.874508928571004 ns/iter 11.724123214284937 ns/iter 1.01
Regex_Caret_Period_Range_Dollar 8.771090585844108 ns/iter 8.891457549591264 ns/iter 0.99
Regex_Nested_Backtrack 588.5875892856924 ns/iter 593.6268749999434 ns/iter 0.99
Pointer_Object_Traverse 56.308107142858226 ns/iter 56.26452999999856 ns/iter 1.00
Pointer_Object_Try_Traverse 76.385669642866 ns/iter 76.03017857142902 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 178.0819583536858 ns/iter 182.63018856898375 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 (linux/gcc)

Benchmark suite Current: 6667b99 Previous: 438dac1 Ratio
Pointer_Object_Traverse 44.442655358362416 ns/iter 44.1275484282256 ns/iter 1.01
Pointer_Object_Try_Traverse 23.494253306557223 ns/iter 22.438716070721192 ns/iter 1.05
Pointer_Push_Back_Pointer_To_Weak_Pointer 213.10647199887742 ns/iter 213.3736041370176 ns/iter 1.00
Regex_Lower_S_Or_Upper_S_Asterisk 2.4867689628241503 ns/iter 2.4941914969864163 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.4866296913992514 ns/iter 2.489157737158053 ns/iter 1.00
Regex_Period_Asterisk 2.4900820195803837 ns/iter 2.4957267044485096 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 2.500625816047421 ns/iter 2.4903199444798965 ns/iter 1.00
Regex_Period_Plus 2.7996740635189394 ns/iter 2.4915887736749815 ns/iter 1.12
Regex_Period 2.798593663171218 ns/iter 2.4911814498351137 ns/iter 1.12
Regex_Caret_Period_Plus_Dollar 2.801115065661819 ns/iter 2.488630855411089 ns/iter 1.13
Regex_Caret_Group_Period_Plus_Group_Dollar 2.799230646183924 ns/iter 2.4889561385313606 ns/iter 1.12
Regex_Caret_Period_Asterisk_Dollar 3.7366498414245948 ns/iter 2.4886379096943947 ns/iter 1.50
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.72887042415774 ns/iter 2.496287168191894 ns/iter 1.49
Regex_Caret_X_Hyphen 12.430287154594764 ns/iter 12.439272961492469 ns/iter 1.00
Regex_Period_Md_Dollar 87.76658876557609 ns/iter 87.82263452027476 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 7.1544644729608855 ns/iter 6.229299395572457 ns/iter 1.15
Regex_Caret_Period_Range_Dollar 4.041553739499392 ns/iter 4.046143589666995 ns/iter 1.00
Regex_Nested_Backtrack 812.0105512761013 ns/iter 811.7215946082592 ns/iter 1.00
JSON_Array_Of_Objects_Unique 379.34210943864036 ns/iter 381.3255813451859 ns/iter 0.99
JSON_Parse_1 32831.962390520355 ns/iter 32817.89266354757 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 62.99960128501887 ns/iter 63.32165406208655 ns/iter 0.99
JSON_Equality_Helm_Chart_Lock 145.29841994331204 ns/iter 143.03929791445609 ns/iter 1.02

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

Please sign in to comment.