Skip to content

Commit

Permalink
Revise JSON Schema public interface (#1502)
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 97b4930 commit ddad44e
Show file tree
Hide file tree
Showing 49 changed files with 1,327 additions and 1,829 deletions.
2 changes: 1 addition & 1 deletion src/core/jsonschema/default_walker.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <sourcemeta/core/jsonschema_walker.h>

auto sourcemeta::core::default_schema_walker(
auto sourcemeta::core::schema_official_walker(
std::string_view keyword, const std::map<std::string, bool> &vocabularies)
-> sourcemeta::core::SchemaWalkerResult {
#define WALK(vocabulary, _keyword, strategy, ...) \
Expand Down
4 changes: 2 additions & 2 deletions src/core/jsonschema/include/sourcemeta/core/jsonschema.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ auto schema_format_compare(const JSON::String &left, const JSON::String &right)
/// })JSON");
///
/// sourcemeta::core::relativize(schema,
/// sourcemeta::core::default_schema_walker,
/// sourcemeta::core::schema_official_walker,
/// sourcemeta::core::official_resolver);
///
/// const sourcemeta::core::JSON expected =
Expand Down Expand Up @@ -375,7 +375,7 @@ auto relativize(
/// })JSON");
///
/// sourcemeta::core::unidentify(schema,
/// sourcemeta::core::default_schema_walker,
/// sourcemeta::core::schema_official_walker,
/// sourcemeta::core::official_resolver);
///
/// const sourcemeta::core::JSON expected =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace sourcemeta::core {
/// })JSON");
///
/// sourcemeta::core::bundle(document,
/// sourcemeta::core::default_schema_walker, test_resolver);
/// sourcemeta::core::schema_official_walker, test_resolver);
///
/// const sourcemeta::core::JSON expected =
/// sourcemeta::core::parse_json(R"JSON({
Expand Down Expand Up @@ -106,7 +106,7 @@ auto bundle(sourcemeta::core::JSON &schema, const SchemaWalker &walker,
///
/// const sourcemeta::core::JSON result =
/// sourcemeta::core::bundle(document,
/// sourcemeta::core::default_schema_walker, test_resolver);
/// sourcemeta::core::schema_official_walker, test_resolver);
///
/// const sourcemeta::core::JSON expected =
/// sourcemeta::core::parse_json(R"JSON({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace sourcemeta::core {
///
/// sourcemeta::core::SchemaSchemaFrame frame;
/// frame.analyse(document,
/// sourcemeta::core::default_schema_walker,
/// sourcemeta::core::schema_official_walker,
/// sourcemeta::core::official_resolver);
///
/// // IDs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class SOURCEMETA_CORE_JSONSCHEMA_EXPORT SchemaTransformRule {
/// })JSON");
///
/// // Apply the transformation bundle to the schema
/// bundle.apply(schema, sourcemeta::core::default_schema_walker,
/// bundle.apply(schema, sourcemeta::core::schema_official_walker,
/// sourcemeta::core::official_resolver);
///
/// // `foo` keywords are gone
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ using SchemaUnevaluatedEntries = std::map<std::string, SchemaUnevaluatedEntry>;
///
/// sourcemeta::core::SchemaSchemaFrame frame;
/// frame.analyse(document,
/// sourcemeta::core::default_schema_walker,
/// sourcemeta::core::schema_official_walker,
/// sourcemeta::core::official_resolver);
/// const auto result{sourcemeta::core::unevaluated(
/// schema, frame,
/// sourcemeta::core::default_schema_walker,
/// sourcemeta::core::schema_official_walker,
/// sourcemeta::core::official_resolver)};
///
/// assert(result.contains("#/unevaluatedProperties"));
Expand Down
25 changes: 8 additions & 17 deletions src/core/jsonschema/include/sourcemeta/core/jsonschema_walker.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,16 @@ struct SchemaWalkerResult {
///
/// For convenience, we provide the following default walkers:
///
/// - sourcemeta::core::default_schema_walker
/// - sourcemeta::core::schema_official_walker
/// - sourcemeta::core::schema_walker_none
using SchemaWalker = std::function<SchemaWalkerResult(
std::string_view, const std::map<std::string, bool> &)>;

/// @ingroup jsonschema
/// A stub walker that doesn't walk
SOURCEMETA_CORE_JSONSCHEMA_EXPORT
inline auto schema_walker_none(std::string_view,
const std::map<std::string, bool> &)
-> sourcemeta::core::SchemaWalkerResult {
return {SchemaKeywordType::Unknown, std::nullopt, {}};
}

/// @ingroup jsonschema
/// A default schema walker with support for a wide range of drafs
SOURCEMETA_CORE_JSONSCHEMA_EXPORT
auto default_schema_walker(std::string_view keyword,
const std::map<std::string, bool> &vocabularies)
auto schema_official_walker(std::string_view keyword,
const std::map<std::string, bool> &vocabularies)
-> sourcemeta::core::SchemaWalkerResult;

/// @ingroup jsonschema
Expand Down Expand Up @@ -105,7 +96,7 @@ struct SchemaIteratorEntry {
///
/// for (const auto &entry :
/// sourcemeta::core::SchemaIterator{
/// document, sourcemeta::core::default_schema_walker,
/// document, sourcemeta::core::schema_official_walker,
/// sourcemeta::core::official_resolver}) {
/// sourcemeta::core::prettify(
/// sourcemeta::core::get(document, entry.pointer), std::cout);
Expand Down Expand Up @@ -172,7 +163,7 @@ class SOURCEMETA_CORE_JSONSCHEMA_EXPORT SchemaIterator {
///
/// for (const auto &entry :
/// sourcemeta::core::SchemaIteratorFlat{
/// document, sourcemeta::core::default_schema_walker,
/// document, sourcemeta::core::schema_official_walker,
/// sourcemeta::core::official_resolver}) {
/// sourcemeta::core::prettify(
/// sourcemeta::core::get(document, entry.pointer), std::cout);
Expand Down Expand Up @@ -235,12 +226,12 @@ class SOURCEMETA_CORE_JSONSCHEMA_EXPORT SchemaIteratorFlat {
///
/// assert(sourcemeta::core::schema_keyword_priority(
/// "prefixItems", vocabularies,
/// sourcemeta::core::default_schema_walker) == 0);
/// sourcemeta::core::schema_official_walker) == 0);
///
/// // The "items" keyword must be evaluated after the "prefixItems" keyword
/// assert(sourcemeta::core::schema_keyword_priority(
/// "items", vocabularies,
/// sourcemeta::core::default_schema_walker) == 1);
/// sourcemeta::core::schema_official_walker) == 1);
/// ```
auto SOURCEMETA_CORE_JSONSCHEMA_EXPORT schema_keyword_priority(
std::string_view keyword, const std::map<std::string, bool> &vocabularies,
Expand Down Expand Up @@ -269,7 +260,7 @@ auto SOURCEMETA_CORE_JSONSCHEMA_EXPORT schema_keyword_priority(
///
/// for (const auto &entry :
/// sourcemeta::core::SchemaKeywordIterator{
/// document, sourcemeta::core::default_schema_walker,
/// document, sourcemeta::core::schema_official_walker,
/// sourcemeta::core::official_resolver}) {
/// sourcemeta::core::stringify(entry.pointer, std::cout);
/// std::cout << "\n";
Expand Down
4 changes: 2 additions & 2 deletions src/core/jsonschema/resolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ auto SchemaMapResolver::add(const JSON &schema,
// Registering the top-level schema is not enough. We need to check
// and register every embedded schema resource too
SchemaFrame frame;
frame.analyse(schema, default_schema_walker, *this, default_dialect,
frame.analyse(schema, schema_official_walker, *this, default_dialect,
default_id);

for (const auto &[key, entry] : frame.locations()) {
Expand Down Expand Up @@ -150,7 +150,7 @@ auto SchemaFlatFileResolver::operator()(std::string_view identifier) const
*this, result->second.default_dialect);
// Because we allow re-identification, we can get into issues unless we
// always try to relativize references
sourcemeta::core::relativize(schema, default_schema_walker, *this,
sourcemeta::core::relativize(schema, schema_official_walker, *this,
result->second.default_dialect,
result->second.original_identifier);
sourcemeta::core::reidentify(schema, result->first, *this,
Expand Down
2 changes: 2 additions & 0 deletions src/core/jsonschema/transformer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ auto SchemaTransformer::apply(

// (2) Transform its sub-schemas
for (const auto &entry :
// TODO: Replace `SchemaIteratorFlat` with framing and then just get
// rid of the idea of flat iterators, as we don't need it anywhere else
SchemaIteratorFlat{current, walker, resolver, effective_dialect}) {
apply(schema, walker, resolver, pointer.concat(entry.pointer),
effective_dialect);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ enum class AlterSchemaCategory {
/// }
/// })JSON");
///
/// bundle.apply(schema, sourcemeta::core::default_schema_walker,
/// bundle.apply(schema, sourcemeta::core::schema_official_walker,
/// sourcemeta::core::official_resolver);
/// ```
SOURCEMETA_CORE_ALTERSCHEMA_EXPORT
Expand Down
4 changes: 2 additions & 2 deletions test/alterschema/alterschema_test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
sourcemeta::core::AlterSchemaCategory::Redundant); \
sourcemeta::core::add(bundle, \
sourcemeta::core::AlterSchemaCategory::SyntaxSugar); \
bundle.apply(document, sourcemeta::core::default_schema_walker, \
bundle.apply(document, sourcemeta::core::schema_official_walker, \
sourcemeta::core::official_resolver);

#define LINT_AND_FIX_FOR_ANALYSIS(document) \
Expand All @@ -31,7 +31,7 @@
sourcemeta::core::AlterSchemaCategory::Implicit); \
sourcemeta::core::add(bundle, \
sourcemeta::core::AlterSchemaCategory::Desugar); \
bundle.apply(document, sourcemeta::core::default_schema_walker, \
bundle.apply(document, sourcemeta::core::schema_official_walker, \
sourcemeta::core::official_resolver);

#endif
1 change: 0 additions & 1 deletion test/jsonschema/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ sourcemeta_googletest(NAMESPACE sourcemeta PROJECT core NAME jsonschema
jsonschema_default_walker_draft2_test.cc
jsonschema_default_walker_draft1_test.cc
jsonschema_default_walker_draft0_test.cc
jsonschema_walker_none_test.cc
jsonschema_walker_test.cc
jsonschema_error_test.cc
jsonschema_keyword_iterator_test.cc
Expand Down
42 changes: 21 additions & 21 deletions test/jsonschema/jsonschema_bundle_2019_09_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ TEST(JSONSchema_bundle_2019_09, no_references_no_id) {
"$schema": "https://json-schema.org/draft/2019-09/schema"
})JSON");

sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);

const sourcemeta::core::JSON expected = sourcemeta::core::parse_json(R"JSON({
Expand All @@ -108,7 +108,7 @@ TEST(JSONSchema_bundle_2019_09, const_no_references_no_id) {
})JSON");

const auto result = sourcemeta::core::bundle(
document, sourcemeta::core::default_schema_walker, test_resolver);
document, sourcemeta::core::schema_official_walker, test_resolver);

const sourcemeta::core::JSON expected = sourcemeta::core::parse_json(R"JSON({
"$schema": "https://json-schema.org/draft/2019-09/schema"
Expand All @@ -129,7 +129,7 @@ TEST(JSONSchema_bundle_2019_09, simple_with_id) {
}
})JSON");

sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);

const sourcemeta::core::JSON expected = sourcemeta::core::parse_json(R"JSON({
Expand Down Expand Up @@ -179,7 +179,7 @@ TEST(JSONSchema_bundle_2019_09, simple_without_id) {
}
})JSON");

sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);

const sourcemeta::core::JSON expected = sourcemeta::core::parse_json(R"JSON({
Expand Down Expand Up @@ -226,10 +226,10 @@ TEST(JSONSchema_bundle_2019_09, schema_not_found) {
}
})JSON");

EXPECT_THROW(sourcemeta::core::bundle(document,
sourcemeta::core::default_schema_walker,
test_resolver),
sourcemeta::core::SchemaResolutionError);
EXPECT_THROW(
sourcemeta::core::bundle(
document, sourcemeta::core::schema_official_walker, test_resolver),
sourcemeta::core::SchemaResolutionError);
}

TEST(JSONSchema_bundle_2019_09, idempotency) {
Expand All @@ -241,11 +241,11 @@ TEST(JSONSchema_bundle_2019_09, idempotency) {
}
})JSON");

sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);
sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);
sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);

const sourcemeta::core::JSON expected = sourcemeta::core::parse_json(R"JSON({
Expand Down Expand Up @@ -292,7 +292,7 @@ TEST(JSONSchema_bundle_2019_09, pre_embedded) {
}
})JSON");

sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);

const sourcemeta::core::JSON expected = sourcemeta::core::parse_json(R"JSON({
Expand Down Expand Up @@ -339,7 +339,7 @@ TEST(JSONSchema_bundle_2019_09, taken_definitions_entry) {
}
})JSON");

sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);

const sourcemeta::core::JSON expected = sourcemeta::core::parse_json(R"JSON({
Expand Down Expand Up @@ -376,7 +376,7 @@ TEST(JSONSchema_bundle_2019_09, recursive) {
"$ref": "https://www.sourcemeta.com/recursive"
})JSON");

sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);

const sourcemeta::core::JSON expected = sourcemeta::core::parse_json(R"JSON({
Expand All @@ -402,7 +402,7 @@ TEST(JSONSchema_bundle_2019_09, recursive_empty_fragment) {
"$ref": "https://www.sourcemeta.com/recursive-empty-fragment#"
})JSON");

sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);

const sourcemeta::core::JSON expected = sourcemeta::core::parse_json(R"JSON({
Expand All @@ -427,7 +427,7 @@ TEST(JSONSchema_bundle_2019_09, anonymous_no_dialect) {
"$ref": "https://www.sourcemeta.com/anonymous"
})JSON");

sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver,
"https://json-schema.org/draft/2019-09/schema");

Expand All @@ -450,7 +450,7 @@ TEST(JSONSchema_bundle_2019_09, metaschema) {
"type": "string"
})JSON");

sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);

const sourcemeta::core::JSON expected = sourcemeta::core::parse_json(R"JSON({
Expand Down Expand Up @@ -485,7 +485,7 @@ TEST(JSONSchema_bundle_2019_09, relative_base_uri_with_ref) {
}
})JSON");

sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);

const sourcemeta::core::JSON expected = sourcemeta::core::parse_json(R"JSON({
Expand All @@ -508,7 +508,7 @@ TEST(JSONSchema_bundle_2019_09, hyperschema_smoke) {
"$ref": "https://json-schema.org/draft/2019-09/hyper-schema"
})JSON");

sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);

EXPECT_TRUE(document.is_object());
Expand All @@ -523,7 +523,7 @@ TEST(JSONSchema_bundle_2019_09, hyperschema_1) {
]
})JSON");

sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);

EXPECT_TRUE(document.defines("$defs"));
Expand Down Expand Up @@ -558,7 +558,7 @@ TEST(JSONSchema_bundle_2019_09, hyperschema_2) {
"https://json-schema.org/draft/2019-09/hyper-schema")
.value();

sourcemeta::core::bundle(document, sourcemeta::core::default_schema_walker,
sourcemeta::core::bundle(document, sourcemeta::core::schema_official_walker,
test_resolver);

EXPECT_TRUE(document.defines("$defs"));
Expand Down
Loading

5 comments on commit ddad44e

@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: ddad44e Previous: 97b4930 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.7950566156935461 ns/iter 2.0795258728873245 ns/iter 0.86
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.853251665431244 ns/iter 1.900586981410975 ns/iter 0.98
Regex_Period_Asterisk 1.8290267267128908 ns/iter 1.9981844700358833 ns/iter 0.92
Regex_Group_Period_Asterisk_Group 1.714939161533693 ns/iter 2.0652798824196963 ns/iter 0.83
Regex_Period_Plus 2.1248440910745607 ns/iter 2.6341280845898347 ns/iter 0.81
Regex_Period 2.1599833173064344 ns/iter 2.3278764141279438 ns/iter 0.93
Regex_Caret_Period_Plus_Dollar 2.0614503013614063 ns/iter 2.5215366747066454 ns/iter 0.82
Regex_Caret_Group_Period_Plus_Group_Dollar 2.0451073143676712 ns/iter 2.2011386863130737 ns/iter 0.93
Regex_Caret_Period_Asterisk_Dollar 1.709511790274934 ns/iter 1.8799913213221484 ns/iter 0.91
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.7085095405480262 ns/iter 1.8628617656843047 ns/iter 0.92
Regex_Caret_X_Hyphen 7.218675493797549 ns/iter 7.363098059319244 ns/iter 0.98
Regex_Period_Md_Dollar 73.80735190269515 ns/iter 81.57184989189872 ns/iter 0.90
Regex_Caret_Slash_Period_Asterisk 5.4597284438883324 ns/iter 6.1311295426350485 ns/iter 0.89
Regex_Caret_Period_Range_Dollar 2.3743588472589137 ns/iter 2.8472503789857293 ns/iter 0.83
Regex_Nested_Backtrack 826.473008475541 ns/iter 902.0403738510777 ns/iter 0.92
JSON_Array_Of_Objects_Unique 353.1155985589121 ns/iter 404.0183077209319 ns/iter 0.87
JSON_Parse_1 23067.212471808623 ns/iter 29291.21111574914 ns/iter 0.79
JSON_Fast_Hash_Helm_Chart_Lock 52.241250931299895 ns/iter 54.42421845511831 ns/iter 0.96
JSON_Equality_Helm_Chart_Lock 128.76680583079008 ns/iter 161.45317164939155 ns/iter 0.80
JSON_String_Equal/10 8.115481956691076 ns/iter 10.247032607629038 ns/iter 0.79
JSON_String_Equal/100 6.531278869154012 ns/iter 7.859067061508749 ns/iter 0.83
JSON_String_Equal_Small_By_Perfect_Hash/10 0.34860368904708167 ns/iter 0.4710933279317561 ns/iter 0.74
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.15340390644528 ns/iter 4.104461974432593 ns/iter 0.77
JSON_String_Fast_Hash/10 1.7729959032769385 ns/iter 2.0384044274393154 ns/iter 0.87
JSON_String_Fast_Hash/100 2.2350271241018347 ns/iter 2.4117017752558154 ns/iter 0.93
JSON_String_Key_Hash/10 1.5036848858631668 ns/iter 1.6829434624130353 ns/iter 0.89
JSON_String_Key_Hash/100 1.4030709433194684 ns/iter 1.872159961228198 ns/iter 0.75
JSON_Object_Defines_Miss_Same_Length 2.34031611105411 ns/iter 3.2032579645039183 ns/iter 0.73
JSON_Object_Defines_Miss_Too_Small 2.335770717460812 ns/iter 2.9329755362681427 ns/iter 0.80
JSON_Object_Defines_Miss_Too_Large 2.389202661606593 ns/iter 3.162322933510721 ns/iter 0.76
Pointer_Object_Traverse 18.285521581718758 ns/iter 22.136578505828325 ns/iter 0.83
Pointer_Object_Try_Traverse 23.210407602056836 ns/iter 30.49808971925383 ns/iter 0.76
Pointer_Push_Back_Pointer_To_Weak_Pointer 183.20189570877227 ns/iter 217.8467662028683 ns/iter 0.84

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: ddad44e Previous: 97b4930 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.2162926137557424 ns/iter 2.2098587151273037 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.19925760508802 ns/iter 2.2016408498886455 ns/iter 1.00
Regex_Period_Asterisk 2.222055011372764 ns/iter 2.1897914035213035 ns/iter 1.01
Regex_Group_Period_Asterisk_Group 2.2159846646958856 ns/iter 2.218739022198521 ns/iter 1.00
Regex_Period_Plus 2.7984984732370224 ns/iter 2.797361990148969 ns/iter 1.00
Regex_Period 2.7973273744300964 ns/iter 2.7971234798423033 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 2.7972943806127115 ns/iter 2.7977165776701733 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 2.799724504973251 ns/iter 2.7965981082977827 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 3.4175891559231735 ns/iter 3.4186215502456654 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.0677715740681295 ns/iter 3.4164711516314363 ns/iter 0.90
Regex_Caret_X_Hyphen 12.534412000613331 ns/iter 13.077046534556654 ns/iter 0.96
Regex_Period_Md_Dollar 81.91681405256837 ns/iter 82.25123700771896 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 6.6872714057223055 ns/iter 5.905823341577745 ns/iter 1.13
Regex_Caret_Period_Range_Dollar 2.799913534837519 ns/iter 4.105037112952024 ns/iter 0.68
Regex_Nested_Backtrack 506.9051855918277 ns/iter 498.24015060527876 ns/iter 1.02
JSON_Array_Of_Objects_Unique 404.5395811087389 ns/iter 402.13537061096264 ns/iter 1.01
JSON_Parse_1 32879.94732878171 ns/iter 30254.051992918412 ns/iter 1.09
JSON_Fast_Hash_Helm_Chart_Lock 59.26342336518386 ns/iter 59.36388624110974 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 151.09449677582927 ns/iter 151.00639652495593 ns/iter 1.00
JSON_String_Equal/10 6.221398210396156 ns/iter 6.222143740269638 ns/iter 1.00
JSON_String_Equal/100 6.845746210589001 ns/iter 6.852161027328132 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9347560554982254 ns/iter 0.934710320510993 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.604553607377483 ns/iter 10.260992209429737 ns/iter 1.42
JSON_String_Fast_Hash/10 2.489004316153174 ns/iter 2.489903811714908 ns/iter 1.00
JSON_String_Fast_Hash/100 2.4882760539049587 ns/iter 2.4892993126702754 ns/iter 1.00
JSON_String_Key_Hash/10 2.6915433373998323 ns/iter 2.17850669738415 ns/iter 1.24
JSON_String_Key_Hash/100 1.8671227177219818 ns/iter 1.8663222663224526 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.7379340161621424 ns/iter 3.738043978743922 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.7368265537435987 ns/iter 3.738051164952342 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.7354244449260205 ns/iter 3.7385605022259996 ns/iter 1.00
Pointer_Object_Traverse 44.31272349617659 ns/iter 44.43308577893429 ns/iter 1.00
Pointer_Object_Try_Traverse 52.35096127677514 ns/iter 52.34528038611598 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 336.7260238297816 ns/iter 308.4915896230929 ns/iter 1.09

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: ddad44e Previous: 97b4930 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 6.900263392856892 ns/iter 6.876897321429202 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 6.96007589285687 ns/iter 6.8928917410713915 ns/iter 1.01
Regex_Period_Asterisk 7.476724330357192 ns/iter 7.0548683035731585 ns/iter 1.06
Regex_Group_Period_Asterisk_Group 6.89253880851562 ns/iter 6.836526785714828 ns/iter 1.01
Regex_Period_Plus 7.1573515624999215 ns/iter 7.543497767856471 ns/iter 0.95
Regex_Period 7.5322366071427025 ns/iter 7.198368749998606 ns/iter 1.05
Regex_Caret_Period_Plus_Dollar 7.250621651784885 ns/iter 7.213687499998401 ns/iter 1.01
Regex_Caret_Group_Period_Plus_Group_Dollar 7.407758928571643 ns/iter 7.244962053571311 ns/iter 1.02
Regex_Caret_Period_Asterisk_Dollar 6.974462053570869 ns/iter 6.86750446428519 ns/iter 1.02
Regex_Caret_Group_Period_Asterisk_Group_Dollar 6.881459821428848 ns/iter 7.101599968296042 ns/iter 0.97
Regex_Caret_X_Hyphen 11.760376562499175 ns/iter 14.266118909524442 ns/iter 0.82
Regex_Period_Md_Dollar 151.39319196428858 ns/iter 151.4671651785347 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 10.438007812499706 ns/iter 10.26693281250246 ns/iter 1.02
Regex_Caret_Period_Range_Dollar 7.816242187500068 ns/iter 7.665158482144108 ns/iter 1.02
Regex_Nested_Backtrack 630.9060714285814 ns/iter 611.2467000000379 ns/iter 1.03
JSON_Array_Of_Objects_Unique 495.9793749999822 ns/iter 498.04050000011557 ns/iter 1.00
JSON_Parse_1 82169.85491072494 ns/iter 79974.26339286001 ns/iter 1.03
JSON_Fast_Hash_Helm_Chart_Lock 66.78844642857078 ns/iter 63.80287946429673 ns/iter 1.05
JSON_Equality_Helm_Chart_Lock 187.488820311524 ns/iter 190.75346346013242 ns/iter 0.98
JSON_String_Equal/10 9.012378977624522 ns/iter 9.000914691958386 ns/iter 1.00
JSON_String_Equal/100 9.955181205556839 ns/iter 9.989322276835715 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 2.1685978125002947 ns/iter 2.1695109374995525 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.977938549205437 ns/iter 15.10811607142821 ns/iter 0.99
JSON_String_Fast_Hash/10 4.040159845424279 ns/iter 4.029065051838041 ns/iter 1.00
JSON_String_Fast_Hash/100 4.058628444747891 ns/iter 4.029090587551515 ns/iter 1.01
JSON_String_Key_Hash/10 7.874675223214262 ns/iter 7.859871393482082 ns/iter 1.00
JSON_String_Key_Hash/100 4.029894382196088 ns/iter 4.028197998264745 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.7367399933272316 ns/iter 3.746671600451823 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 4.95210400000019 ns/iter 4.961602999999286 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.418432672467101 ns/iter 3.416456109969759 ns/iter 1.00
Pointer_Object_Traverse 50.079840000000786 ns/iter 48.9539700000023 ns/iter 1.02
Pointer_Object_Try_Traverse 67.7630892857195 ns/iter 67.638633928563 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 179.16354324754678 ns/iter 163.06604910713165 ns/iter 1.10

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: ddad44e Previous: 97b4930 Ratio
Pointer_Object_Traverse 45.32103746526691 ns/iter 45.7678396903338 ns/iter 0.99
Pointer_Object_Try_Traverse 26.155797626481306 ns/iter 26.10552410021411 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 144.25206995015336 ns/iter 146.0696940729446 ns/iter 0.99
JSON_Array_Of_Objects_Unique 423.68275324715 ns/iter 432.84223624627924 ns/iter 0.98
JSON_Parse_1 33175.350879684425 ns/iter 33220.48805444475 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 62.62528667570228 ns/iter 68.88871887567379 ns/iter 0.91
JSON_Equality_Helm_Chart_Lock 149.21883704557348 ns/iter 147.40067478125778 ns/iter 1.01
JSON_String_Equal/10 6.34636903337211 ns/iter 6.3352013613039935 ns/iter 1.00
JSON_String_Equal/100 6.96372439377715 ns/iter 6.964321279618878 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9347843746682979 ns/iter 0.9330641593472272 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.292526535017345 ns/iter 14.2868262435317 ns/iter 1.00
JSON_String_Fast_Hash/10 0.9376002356537873 ns/iter 0.9326792112386526 ns/iter 1.01
JSON_String_Fast_Hash/100 0.9337595355250484 ns/iter 0.9327539821487121 ns/iter 1.00
JSON_String_Key_Hash/10 1.6725387254018165 ns/iter 1.6722640117210488 ns/iter 1.00
JSON_String_Key_Hash/100 1.9837409301886113 ns/iter 1.9827411984046144 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 2.4875158809874662 ns/iter 2.490449108460974 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 2.4866713285663824 ns/iter 2.4889505154554685 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.115256555315382 ns/iter 3.1113642021276666 ns/iter 1.00
Regex_Lower_S_Or_Upper_S_Asterisk 3.4201361579092713 ns/iter 3.4218297355281675 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 3.4197119717306235 ns/iter 3.42222318662483 ns/iter 1.00
Regex_Period_Asterisk 3.4392454973788666 ns/iter 3.4203927157812704 ns/iter 1.01
Regex_Group_Period_Asterisk_Group 3.426070311371711 ns/iter 3.4197692219521163 ns/iter 1.00
Regex_Period_Plus 3.420809889513224 ns/iter 3.7831826626144074 ns/iter 0.90
Regex_Period 3.419203399803127 ns/iter 3.7597288172274244 ns/iter 0.91
Regex_Caret_Period_Plus_Dollar 3.4242043506928064 ns/iter 3.732531040868804 ns/iter 0.92
Regex_Caret_Group_Period_Plus_Group_Dollar 3.4216662886505502 ns/iter 3.7349811295172826 ns/iter 0.92
Regex_Caret_Period_Asterisk_Dollar 3.7310742693515957 ns/iter 3.492014048777797 ns/iter 1.07
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.7295946349882154 ns/iter 3.4199858411905457 ns/iter 1.09
Regex_Caret_X_Hyphen 13.273091627352622 ns/iter 13.124558199726573 ns/iter 1.01
Regex_Period_Md_Dollar 89.88527086696136 ns/iter 88.8592891917554 ns/iter 1.01
Regex_Caret_Slash_Period_Asterisk 8.08154110946453 ns/iter 7.146990442522422 ns/iter 1.13
Regex_Caret_Period_Range_Dollar 4.661508996071633 ns/iter 3.4181999520373596 ns/iter 1.36
Regex_Nested_Backtrack 836.7374187509896 ns/iter 819.4720528614882 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/gcc)

Benchmark suite Current: ddad44e Previous: 97b4930 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.9247922871571648 ns/iter 2.1377475672394706 ns/iter 0.90
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.9506176550170498 ns/iter 2.073204088317801 ns/iter 0.94
Regex_Period_Asterisk 1.9470040286959447 ns/iter 2.040108356447086 ns/iter 0.95
Regex_Group_Period_Asterisk_Group 1.9125224586607763 ns/iter 2.040202048297104 ns/iter 0.94
Regex_Period_Plus 1.9110298431902022 ns/iter 2.061490211505423 ns/iter 0.93
Regex_Period 1.954149280151372 ns/iter 2.078306432368491 ns/iter 0.94
Regex_Caret_Period_Plus_Dollar 1.923371330147804 ns/iter 2.0029643604421836 ns/iter 0.96
Regex_Caret_Group_Period_Plus_Group_Dollar 1.925122438015843 ns/iter 2.0140446441526367 ns/iter 0.96
Regex_Caret_Period_Asterisk_Dollar 1.9493304310313206 ns/iter 2.0348776056389233 ns/iter 0.96
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.2358413501957233 ns/iter 2.4763371566771006 ns/iter 0.90
Regex_Caret_X_Hyphen 6.111231946522103 ns/iter 6.474068531623166 ns/iter 0.94
Regex_Period_Md_Dollar 69.7881278065978 ns/iter 74.56593647539144 ns/iter 0.94
Regex_Caret_Slash_Period_Asterisk 4.4487990864563836 ns/iter 4.687675264028264 ns/iter 0.95
Regex_Caret_Period_Range_Dollar 1.9582676864443849 ns/iter 1.9830267423668893 ns/iter 0.99
Regex_Nested_Backtrack 830.6790275992772 ns/iter 860.8714943888306 ns/iter 0.96
JSON_Array_Of_Objects_Unique 214.11397532785048 ns/iter 223.14341001354458 ns/iter 0.96
JSON_Parse_1 23392.437118194484 ns/iter 24703.16820547436 ns/iter 0.95
JSON_Fast_Hash_Helm_Chart_Lock 25.272008005675385 ns/iter 25.24927929430813 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 115.70502784304887 ns/iter 121.22837012106777 ns/iter 0.95
JSON_String_Equal/10 5.45784997069716 ns/iter 5.6557095884104225 ns/iter 0.97
JSON_String_Equal/100 5.171498426498031 ns/iter 5.41370805767281 ns/iter 0.96
JSON_String_Equal_Small_By_Perfect_Hash/10 0.7579414911608794 ns/iter 0.8280984162496426 ns/iter 0.92
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.5355491327623945 ns/iter 3.718684304624199 ns/iter 0.95
JSON_String_Fast_Hash/10 1.944182201417723 ns/iter 2.027995453377608 ns/iter 0.96
JSON_String_Fast_Hash/100 1.9553813386451515 ns/iter 2.0194888203830192 ns/iter 0.97
JSON_String_Key_Hash/10 1.4617415479323208 ns/iter 1.5194723009625855 ns/iter 0.96
JSON_String_Key_Hash/100 2.0130885233393405 ns/iter 2.0632830169740703 ns/iter 0.98
JSON_Object_Defines_Miss_Same_Length 1.7768491719319544 ns/iter 1.8608094053755413 ns/iter 0.95
JSON_Object_Defines_Miss_Too_Small 2.128341934587564 ns/iter 2.0170726674629336 ns/iter 1.06
JSON_Object_Defines_Miss_Too_Large 1.7540009363519242 ns/iter 1.8246472049551847 ns/iter 0.96
Pointer_Object_Traverse 55.35070630252534 ns/iter 61.40948509143745 ns/iter 0.90
Pointer_Object_Try_Traverse 36.30256837161788 ns/iter 38.4757057490783 ns/iter 0.94
Pointer_Push_Back_Pointer_To_Weak_Pointer 161.85986699265626 ns/iter 170.56790540673393 ns/iter 0.95

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

Please sign in to comment.