Skip to content

Commit

Permalink
Fix broken instance locations on orphan parent schemas (#1538)
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 11, 2025
1 parent f48ed88 commit 21f1b46
Show file tree
Hide file tree
Showing 8 changed files with 330 additions and 23 deletions.
15 changes: 15 additions & 0 deletions benchmark/jsonschema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ static void Schema_Frame_OMC_Full(benchmark::State &state) {
}
}

static void Schema_Frame_OMC_References(benchmark::State &state) {
const auto schema{
sourcemeta::core::read_json(std::filesystem::path{CURRENT_DIRECTORY} /
"schemas" / "2019_09_omc_json_v2.json")};

for (auto _ : state) {
sourcemeta::core::SchemaFrame frame{
sourcemeta::core::SchemaFrame::Mode::References};
frame.analyse(schema, sourcemeta::core::schema_official_walker,
sourcemeta::core::schema_official_resolver);
benchmark::DoNotOptimize(frame);
}
}

static void Schema_Bundle_Meta_2020_12(benchmark::State &state) {
for (auto _ : state) {
state.PauseTiming();
Expand All @@ -34,4 +48,5 @@ static void Schema_Bundle_Meta_2020_12(benchmark::State &state) {
}

BENCHMARK(Schema_Frame_OMC_Full);
BENCHMARK(Schema_Frame_OMC_References);
BENCHMARK(Schema_Bundle_Meta_2020_12);
2 changes: 1 addition & 1 deletion src/core/jsonschema/bundle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ auto bundle(sourcemeta::core::JSON &schema, const SchemaWalker &walker,
const auto vocabularies{
sourcemeta::core::vocabularies(schema, resolver, default_dialect)};
sourcemeta::core::SchemaFrame frame{
sourcemeta::core::SchemaFrame::Mode::Full};
sourcemeta::core::SchemaFrame::Mode::References};
bundle_schema(schema, definitions_keyword(vocabularies), schema, frame,
walker, resolver, default_dialect);
}
Expand Down
124 changes: 107 additions & 17 deletions src/core/jsonschema/frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,89 @@ struct CacheSubschema {
const std::optional<sourcemeta::core::Pointer> parent;
};

auto internal_analyse(const sourcemeta::core::SchemaFrame::Mode,
// TODO: The fact this lookup algorithm is O(N) is the main
// performance problem of framing
static auto find_subschema_by_pointer(
const sourcemeta::core::SchemaFrame::Locations &locations,
const sourcemeta::core::Pointer &pointer)
-> std::optional<std::reference_wrapper<
const sourcemeta::core::SchemaFrame::LocationsEntry>> {
for (const auto &location : locations) {
if (location.second.type !=
sourcemeta::core::SchemaFrame::LocationType::Resource &&
location.second.type !=
sourcemeta::core::SchemaFrame::LocationType::Subschema) {
continue;
}

if (location.second.pointer == pointer) {
return location.second;
}
}

return std::nullopt;
}

static auto repopulate_instance_locations(
const std::map<sourcemeta::core::Pointer, CacheSubschema> &cache,
sourcemeta::core::SchemaFrame::Locations &locations,
const sourcemeta::core::Pointer &, const CacheSubschema &cache_entry,
// This is the output
const sourcemeta::core::Pointer &output,
const std::optional<sourcemeta::core::PointerTemplate> &accumulator)
-> void {
if (cache_entry.orphan
// TODO: Implement an .empty() method
&& cache_entry.instance_location == sourcemeta::core::PointerTemplate{}) {
return;
} else if (cache_entry.parent.has_value()) {
const auto parent_location{
find_subschema_by_pointer(locations, cache_entry.parent.value())};
assert(parent_location.has_value());
for (const auto &parent_instance_location :
parent_location.value().get().instance_locations) {
// Guard against overly unrolling recursive schemas
if (parent_instance_location == cache_entry.instance_location) {
continue;
}

auto new_accumulator = cache_entry.relative_instance_location;
if (accumulator.has_value()) {
for (const auto &token : accumulator.value()) {
new_accumulator.emplace_back(token);
}
}

auto result = parent_instance_location;
for (const auto &token : new_accumulator) {
result.emplace_back(token);
}

// TODO: Look for the output locations once before calling this function
for (auto &location : locations) {
if (location.second.type !=
sourcemeta::core::SchemaFrame::LocationType::Resource &&
location.second.type !=
sourcemeta::core::SchemaFrame::LocationType::Subschema) {
continue;
}

if (location.second.pointer == output &&
std::find(location.second.instance_locations.cbegin(),
location.second.instance_locations.cend(),
result) == location.second.instance_locations.cend()) {
location.second.instance_locations.push_back(result);
}
}

repopulate_instance_locations(
cache, locations, cache_entry.parent.value(),
cache.at(cache_entry.parent.value()), output, new_accumulator);
}
}
}

auto internal_analyse(const sourcemeta::core::SchemaFrame::Mode mode,
const sourcemeta::core::JSON &schema,
sourcemeta::core::SchemaFrame::Locations &frame,
sourcemeta::core::SchemaFrame::References &references,
Expand Down Expand Up @@ -780,29 +862,37 @@ auto internal_analyse(const sourcemeta::core::SchemaFrame::Mode,
}
}

// We only care about marking reference origins from/to resources and
// subschemas
if (mode == sourcemeta::core::SchemaFrame::Mode::Full) {
// We only care about marking reference origins from/to resources and
// subschemas

for (const auto &entry : frame) {
if (entry.second.type != SchemaFrame::LocationType::Resource) {
continue;
for (const auto &entry : frame) {
if (entry.second.type != SchemaFrame::LocationType::Resource) {
continue;
}

mark_reference_origins_from(frame, references, entry);
}

mark_reference_origins_from(frame, references, entry);
}
for (const auto &entry : frame) {
if (entry.second.type != SchemaFrame::LocationType::Subschema) {
continue;
}

for (const auto &entry : frame) {
if (entry.second.type != SchemaFrame::LocationType::Subschema) {
continue;
mark_reference_origins_from(frame, references, entry);
}

mark_reference_origins_from(frame, references, entry);
}
// Calculate alternative unresolved instance locations
for (auto &entry : frame) {
traverse_origin_instance_locations(frame, entry.second, std::nullopt,
entry.second.instance_locations);
}

// Calculate alternative unresolved instance locations
for (auto &entry : frame) {
traverse_origin_instance_locations(frame, entry.second, std::nullopt,
entry.second.instance_locations);
// This is guaranteed to be top-down
for (auto &entry : subschemas) {
repopulate_instance_locations(subschemas, frame, entry.first,
entry.second, entry.first, std::nullopt);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class SOURCEMETA_CORE_JSONSCHEMA_EXPORT SchemaFrame {
public:
/// The mode of framing. More extensive analysis can be compute and memory
/// intensive
enum class Mode { Full };
enum class Mode { References, Full };

SchemaFrame(const Mode mode) : mode_{mode} {}

Expand Down
4 changes: 2 additions & 2 deletions src/core/jsonschema/jsonschema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ auto sourcemeta::core::reference_visit(
const std::optional<std::string> &default_dialect,
const std::optional<std::string> &default_id) -> void {
sourcemeta::core::SchemaFrame frame{
sourcemeta::core::SchemaFrame::Mode::Full};
sourcemeta::core::SchemaFrame::Mode::References};
frame.analyse(schema, walker, resolver, default_dialect, default_id);
for (const auto &entry : frame.locations()) {
if (entry.second.type !=
Expand Down Expand Up @@ -646,7 +646,7 @@ auto sourcemeta::core::unidentify(
const std::optional<std::string> &default_dialect) -> void {
// (1) Re-frame before changing anything
sourcemeta::core::SchemaFrame frame{
sourcemeta::core::SchemaFrame::Mode::Full};
sourcemeta::core::SchemaFrame::Mode::References};
frame.analyse(schema, walker, resolver, default_dialect);

// (2) Remove all identifiers and anchors
Expand Down
2 changes: 1 addition & 1 deletion src/core/jsonschema/resolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,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{SchemaFrame::Mode::Full};
SchemaFrame frame{SchemaFrame::Mode::References};
frame.analyse(schema, schema_official_walker, *this, default_dialect,
default_id);

Expand Down
Loading

5 comments on commit 21f1b46

@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: 21f1b46 Previous: f48ed88 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.2372811355287703 ns/iter 2.2832968705878525 ns/iter 0.98
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.1895886979980976 ns/iter 2.1990017906969794 ns/iter 1.00
Regex_Period_Asterisk 2.2004253622687804 ns/iter 2.1903647178785715 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 2.195528636591202 ns/iter 2.189082508143088 ns/iter 1.00
Regex_Period_Plus 2.492553384371527 ns/iter 2.486903123921891 ns/iter 1.00
Regex_Period 2.4884959270899176 ns/iter 2.4874169656252896 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 2.4857639216603786 ns/iter 2.401375308118531 ns/iter 1.04
Regex_Caret_Group_Period_Plus_Group_Dollar 2.4896817873149217 ns/iter 2.239363371129661 ns/iter 1.11
Regex_Caret_Period_Asterisk_Dollar 2.1969011886220287 ns/iter 2.4894573505094164 ns/iter 0.88
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.185212899661076 ns/iter 2.4864786428741534 ns/iter 0.88
Regex_Caret_X_Hyphen 12.587747517353534 ns/iter 12.527470918932536 ns/iter 1.00
Regex_Period_Md_Dollar 75.46676549163223 ns/iter 73.01065899767119 ns/iter 1.03
Regex_Caret_Slash_Period_Asterisk 6.21439359020511 ns/iter 6.283943849602274 ns/iter 0.99
Regex_Caret_Period_Range_Dollar 4.040731603266973 ns/iter 2.4967149161570057 ns/iter 1.62
Regex_Nested_Backtrack 491.3951275218932 ns/iter 491.02054472827336 ns/iter 1.00
JSON_Array_Of_Objects_Unique 444.63500191324835 ns/iter 447.9086054900762 ns/iter 0.99
JSON_Parse_1 30811.415061141928 ns/iter 30877.517679656194 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 56.5440407732589 ns/iter 68.35021667155996 ns/iter 0.83
JSON_Equality_Helm_Chart_Lock 141.9910215559735 ns/iter 168.1113208475415 ns/iter 0.84
JSON_String_Equal/10 5.290449887889791 ns/iter 7.781218142376171 ns/iter 0.68
JSON_String_Equal/100 5.908331672590665 ns/iter 8.40902593549119 ns/iter 0.70
JSON_String_Equal_Small_By_Perfect_Hash/10 0.935077943476323 ns/iter 0.9373260950202259 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.597003501194562 ns/iter 14.623624054941267 ns/iter 1.00
JSON_String_Fast_Hash/10 2.175648131031131 ns/iter 2.797607312108063 ns/iter 0.78
JSON_String_Fast_Hash/100 2.1765315302745356 ns/iter 2.839632949494221 ns/iter 0.77
JSON_String_Key_Hash/10 2.692708195637965 ns/iter 2.6987592832596623 ns/iter 1.00
JSON_String_Key_Hash/100 2.181652807822037 ns/iter 2.178050797748676 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.7315918043310883 ns/iter 3.7357007158856277 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.731288933582276 ns/iter 3.735991990175984 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.7361100200641393 ns/iter 3.7350307069598183 ns/iter 1.00
Pointer_Object_Traverse 43.57272690639643 ns/iter 44.6575248171356 ns/iter 0.98
Pointer_Object_Try_Traverse 52.60795015541808 ns/iter 52.34610891843722 ns/iter 1.01
Pointer_Push_Back_Pointer_To_Weak_Pointer 287.65481090862625 ns/iter 317.526053001478 ns/iter 0.91
Schema_Frame_OMC_Full 289014142.4999797 ns/iter 237860608.33329734 ns/iter 1.22
Schema_Frame_OMC_References 134743863.19999212 ns/iter
Schema_Bundle_Meta_2020_12 6550960.93458048 ns/iter 10523800.522385012 ns/iter 0.62

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: 21f1b46 Previous: f48ed88 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.6286227471540597 ns/iter 1.7393100714803982 ns/iter 0.94
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.6355715697113844 ns/iter 1.8024295297888875 ns/iter 0.91
Regex_Period_Asterisk 1.6603665273427868 ns/iter 1.9131495492521682 ns/iter 0.87
Regex_Group_Period_Asterisk_Group 1.7423652488242125 ns/iter 1.7384239082150208 ns/iter 1.00
Regex_Period_Plus 2.184743544091224 ns/iter 1.998810738473833 ns/iter 1.09
Regex_Period 2.024156405648628 ns/iter 2.2698473605988974 ns/iter 0.89
Regex_Caret_Period_Plus_Dollar 2.000338512388525 ns/iter 2.004663200926856 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 1.9492974485992092 ns/iter 2.050043573706597 ns/iter 0.95
Regex_Caret_Period_Asterisk_Dollar 1.6954233505928136 ns/iter 1.8559631028941008 ns/iter 0.91
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.6101414077451384 ns/iter 1.7910573447746174 ns/iter 0.90
Regex_Caret_X_Hyphen 6.388082069231616 ns/iter 7.728935152691551 ns/iter 0.83
Regex_Period_Md_Dollar 68.3625140707589 ns/iter 74.3130373608784 ns/iter 0.92
Regex_Caret_Slash_Period_Asterisk 5.945655829999623 ns/iter 5.3882732214591424 ns/iter 1.10
Regex_Caret_Period_Range_Dollar 2.079291416736191 ns/iter 2.408510915491961 ns/iter 0.86
Regex_Nested_Backtrack 739.1471676736093 ns/iter 796.9466938088323 ns/iter 0.93
JSON_Array_Of_Objects_Unique 333.6721083042229 ns/iter 357.26877182765406 ns/iter 0.93
JSON_Parse_1 21888.08084565181 ns/iter 24256.96683977963 ns/iter 0.90
JSON_Fast_Hash_Helm_Chart_Lock 48.93944123409803 ns/iter 61.66722626930113 ns/iter 0.79
JSON_Equality_Helm_Chart_Lock 119.9501169608028 ns/iter 151.85498112050928 ns/iter 0.79
JSON_String_Equal/10 7.742943131308708 ns/iter 9.915483061120131 ns/iter 0.78
JSON_String_Equal/100 6.348010908872339 ns/iter 8.482371471410538 ns/iter 0.75
JSON_String_Equal_Small_By_Perfect_Hash/10 0.33031684964342145 ns/iter 0.3588597324516792 ns/iter 0.92
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.1432326637067387 ns/iter 3.1856514523355273 ns/iter 0.99
JSON_String_Fast_Hash/10 1.646361189905921 ns/iter 1.7727949039577697 ns/iter 0.93
JSON_String_Fast_Hash/100 1.9576997387909656 ns/iter 2.1302347432764495 ns/iter 0.92
JSON_String_Key_Hash/10 1.3741874840591033 ns/iter 1.438914698242369 ns/iter 0.96
JSON_String_Key_Hash/100 1.3487980082469049 ns/iter 1.670806944272945 ns/iter 0.81
JSON_Object_Defines_Miss_Same_Length 2.393719460532972 ns/iter 2.443371086968884 ns/iter 0.98
JSON_Object_Defines_Miss_Too_Small 2.2893880005807077 ns/iter 2.60780324955961 ns/iter 0.88
JSON_Object_Defines_Miss_Too_Large 2.214000847904642 ns/iter 2.371858409713314 ns/iter 0.93
Pointer_Object_Traverse 15.774222071935128 ns/iter 16.820806370864904 ns/iter 0.94
Pointer_Object_Try_Traverse 22.070642851006447 ns/iter 26.979792425873477 ns/iter 0.82
Pointer_Push_Back_Pointer_To_Weak_Pointer 173.63108928862812 ns/iter 230.7717943223696 ns/iter 0.75
Schema_Frame_OMC_Full 188133062.5000146 ns/iter 202657652.9999981 ns/iter 0.93
Schema_Frame_OMC_References 99295881.00000533 ns/iter
Schema_Bundle_Meta_2020_12 4420392.858967932 ns/iter 9329684.14865535 ns/iter 0.47

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: 21f1b46 Previous: f48ed88 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 6.983187499999742 ns/iter 6.76734821428531 ns/iter 1.03
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 6.65259933035551 ns/iter 6.986962499999955 ns/iter 0.95
Regex_Period_Asterisk 6.8692488839288455 ns/iter 6.638455357143818 ns/iter 1.03
Regex_Group_Period_Asterisk_Group 6.618106026784635 ns/iter 6.572868303571511 ns/iter 1.01
Regex_Period_Plus 7.086579241073159 ns/iter 7.08168482142822 ns/iter 1.00
Regex_Period 6.831065178571651 ns/iter 7.715477678571503 ns/iter 0.89
Regex_Caret_Period_Plus_Dollar 7.180812500001212 ns/iter 6.979827008929565 ns/iter 1.03
Regex_Caret_Group_Period_Plus_Group_Dollar 6.858976562499818 ns/iter 7.000033928571879 ns/iter 0.98
Regex_Caret_Period_Asterisk_Dollar 6.80540066964243 ns/iter 6.584970982142581 ns/iter 1.03
Regex_Caret_Group_Period_Asterisk_Group_Dollar 6.732977678571522 ns/iter 6.821566964285708 ns/iter 0.99
Regex_Caret_X_Hyphen 11.913433928571392 ns/iter 11.875676785714568 ns/iter 1.00
Regex_Period_Md_Dollar 164.19825892854638 ns/iter 149.31977678571684 ns/iter 1.10
Regex_Caret_Slash_Period_Asterisk 10.344074999999009 ns/iter 10.318203971793247 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 7.338877678571569 ns/iter 7.357111607142792 ns/iter 1.00
Regex_Nested_Backtrack 605.3169642856103 ns/iter 601.9520535714053 ns/iter 1.01
JSON_Array_Of_Objects_Unique 413.44368243556477 ns/iter 441.83184147363124 ns/iter 0.94
JSON_Parse_1 79696.12723215391 ns/iter 80014.04017857285 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 60.85155357143078 ns/iter 68.94674107142252 ns/iter 0.88
JSON_Equality_Helm_Chart_Lock 187.32242549036684 ns/iter 186.11242540932446 ns/iter 1.01
JSON_String_Equal/10 9.347353083270963 ns/iter 9.626424064166972 ns/iter 0.97
JSON_String_Equal/100 10.096050000001355 ns/iter 10.174285668864837 ns/iter 0.99
JSON_String_Equal_Small_By_Perfect_Hash/10 2.173129999999901 ns/iter 2.172105624999787 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 15.148139184275136 ns/iter 14.786729910714056 ns/iter 1.02
JSON_String_Fast_Hash/10 3.137282348652418 ns/iter 3.7256753504898885 ns/iter 0.84
JSON_String_Fast_Hash/100 3.1267935986352255 ns/iter 3.721634101327458 ns/iter 0.84
JSON_String_Key_Hash/10 7.573142857142707 ns/iter 7.517417377154597 ns/iter 1.01
JSON_String_Key_Hash/100 3.7218476727564407 ns/iter 3.7745099717813555 ns/iter 0.99
JSON_Object_Defines_Miss_Same_Length 4.025739955357821 ns/iter 4.066019873331802 ns/iter 0.99
JSON_Object_Defines_Miss_Too_Small 3.4094296375292794 ns/iter 3.4132813331907506 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.7158299933641334 ns/iter 3.720927314783827 ns/iter 1.00
Pointer_Object_Traverse 53.91521428569896 ns/iter 52.39319999999452 ns/iter 1.03
Pointer_Object_Try_Traverse 65.05564285713409 ns/iter 71.07249999999915 ns/iter 0.92
Pointer_Push_Back_Pointer_To_Weak_Pointer 178.24335520031386 ns/iter 179.92729285064365 ns/iter 0.99
Schema_Frame_OMC_Full 501107199.99997854 ns/iter 493992200.00009334 ns/iter 1.01
Schema_Frame_OMC_References 353123000.000096 ns/iter
Schema_Bundle_Meta_2020_12 16642736.585359538 ns/iter 23203153.571415666 ns/iter 0.72

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: 21f1b46 Previous: f48ed88 Ratio
Schema_Frame_OMC_Full 290592383.49998397 ns/iter 235988345.33333957 ns/iter 1.23
Schema_Frame_OMC_References 137066345.59998748 ns/iter
Schema_Bundle_Meta_2020_12 6778977.533975953 ns/iter 10552611.230771339 ns/iter 0.64
Pointer_Object_Traverse 50.16878083824705 ns/iter 47.78324236195358 ns/iter 1.05
Pointer_Object_Try_Traverse 22.68238332878616 ns/iter 26.498764095404617 ns/iter 0.86
Pointer_Push_Back_Pointer_To_Weak_Pointer 237.39036301739247 ns/iter 163.9962425728427 ns/iter 1.45
JSON_Array_Of_Objects_Unique 423.2290440281095 ns/iter 378.7551558575065 ns/iter 1.12
JSON_Parse_1 33062.633199145945 ns/iter 33346.32657722198 ns/iter 0.99
JSON_Fast_Hash_Helm_Chart_Lock 77.74935830674507 ns/iter 66.21069341679393 ns/iter 1.17
JSON_Equality_Helm_Chart_Lock 148.23759918858562 ns/iter 149.27403106586573 ns/iter 0.99
JSON_String_Equal/10 6.361108807160889 ns/iter 5.71895513666253 ns/iter 1.11
JSON_String_Equal/100 6.972906202489087 ns/iter 6.340516353816064 ns/iter 1.10
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9351458006122005 ns/iter 0.623404756016833 ns/iter 1.50
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 11.646486521390399 ns/iter 25.470462508238207 ns/iter 0.46
JSON_String_Fast_Hash/10 0.9329199724172809 ns/iter 0.9330939637953263 ns/iter 1.00
JSON_String_Fast_Hash/100 0.9326757793124344 ns/iter 0.9361458798457987 ns/iter 1.00
JSON_String_Key_Hash/10 1.2537444509227842 ns/iter 1.2451846076995081 ns/iter 1.01
JSON_String_Key_Hash/100 0.9340486015531092 ns/iter 0.9345726628493335 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 2.487764505552061 ns/iter 2.488935597546653 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 2.7968005329777514 ns/iter 2.801102082700217 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 2.4911868960224455 ns/iter 2.4959492400186636 ns/iter 1.00
Regex_Lower_S_Or_Upper_S_Asterisk 3.4303530475261756 ns/iter 3.1187436797187047 ns/iter 1.10
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 3.4269662490025046 ns/iter 3.1082515770139105 ns/iter 1.10
Regex_Period_Asterisk 3.4205478216946488 ns/iter 3.167274167315304 ns/iter 1.08
Regex_Group_Period_Asterisk_Group 3.4255479796096524 ns/iter 3.1079998204290997 ns/iter 1.10
Regex_Period_Plus 3.7309974537959922 ns/iter 3.4214366269521905 ns/iter 1.09
Regex_Period 3.731182251774868 ns/iter 3.419888399265424 ns/iter 1.09
Regex_Caret_Period_Plus_Dollar 3.730520321022736 ns/iter 3.4213984058686493 ns/iter 1.09
Regex_Caret_Group_Period_Plus_Group_Dollar 3.634015052467331 ns/iter 3.4203433082118795 ns/iter 1.06
Regex_Caret_Period_Asterisk_Dollar 3.729978064835091 ns/iter 4.359788325793043 ns/iter 0.86
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.740614995970497 ns/iter 4.356615792620213 ns/iter 0.86
Regex_Caret_X_Hyphen 13.187560965478578 ns/iter 13.6816921575374 ns/iter 0.96
Regex_Period_Md_Dollar 89.45641760342933 ns/iter 90.03560171781106 ns/iter 0.99
Regex_Caret_Slash_Period_Asterisk 9.454696424024503 ns/iter 8.39309824875925 ns/iter 1.13
Regex_Caret_Period_Range_Dollar 4.6662894684422 ns/iter 4.356293398158149 ns/iter 1.07
Regex_Nested_Backtrack 828.8865100424033 ns/iter 819.8311226522526 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: 21f1b46 Previous: f48ed88 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.9789892218727319 ns/iter 1.8842273992348497 ns/iter 1.05
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.0775216621022934 ns/iter 1.9166816023192932 ns/iter 1.08
Regex_Period_Asterisk 1.9132319217705405 ns/iter 1.962934704058309 ns/iter 0.97
Regex_Group_Period_Asterisk_Group 2.2365625575509664 ns/iter 2.2274376747411075 ns/iter 1.00
Regex_Period_Plus 1.6157103611683648 ns/iter 1.585609007710961 ns/iter 1.02
Regex_Period 1.6450108112909252 ns/iter 1.6064802239264724 ns/iter 1.02
Regex_Caret_Period_Plus_Dollar 1.6713062608723743 ns/iter 1.591965515041057 ns/iter 1.05
Regex_Caret_Group_Period_Plus_Group_Dollar 1.6587666180244696 ns/iter 1.591744524946517 ns/iter 1.04
Regex_Caret_Period_Asterisk_Dollar 1.947062542029765 ns/iter 1.8941118006219209 ns/iter 1.03
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.9839648773552943 ns/iter 1.9101490146644111 ns/iter 1.04
Regex_Caret_X_Hyphen 6.356981256871808 ns/iter 5.965509252167312 ns/iter 1.07
Regex_Period_Md_Dollar 68.90208210056936 ns/iter 69.55630625268383 ns/iter 0.99
Regex_Caret_Slash_Period_Asterisk 4.460750585114547 ns/iter 4.613582778709544 ns/iter 0.97
Regex_Caret_Period_Range_Dollar 1.908936880245721 ns/iter 1.892761526364777 ns/iter 1.01
Regex_Nested_Backtrack 862.0908899152699 ns/iter 873.6987897106665 ns/iter 0.99
JSON_Array_Of_Objects_Unique 219.61489117438316 ns/iter 205.93040164997478 ns/iter 1.07
JSON_Parse_1 23249.432480604937 ns/iter 22973.397719081506 ns/iter 1.01
JSON_Fast_Hash_Helm_Chart_Lock 23.933445519411855 ns/iter 23.513372104071877 ns/iter 1.02
JSON_Equality_Helm_Chart_Lock 116.07723545457931 ns/iter 114.74309202362564 ns/iter 1.01
JSON_String_Equal/10 5.468686137399883 ns/iter 5.4228338684897235 ns/iter 1.01
JSON_String_Equal/100 5.204290876194787 ns/iter 5.114642024864316 ns/iter 1.02
JSON_String_Equal_Small_By_Perfect_Hash/10 0.7552876716168252 ns/iter 0.9446143112956834 ns/iter 0.80
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.478030346675552 ns/iter 3.5063553679656034 ns/iter 0.99
JSON_String_Fast_Hash/10 1.958233409313422 ns/iter 1.900813257317266 ns/iter 1.03
JSON_String_Fast_Hash/100 2.060804550540422 ns/iter 1.9049022497535737 ns/iter 1.08
JSON_String_Key_Hash/10 1.5453953691635205 ns/iter 1.445597800111734 ns/iter 1.07
JSON_String_Key_Hash/100 2.109526210778306 ns/iter 1.9208206774562784 ns/iter 1.10
JSON_Object_Defines_Miss_Same_Length 1.8919907148044683 ns/iter 1.726144784306689 ns/iter 1.10
JSON_Object_Defines_Miss_Too_Small 2.039235756906146 ns/iter 1.8822703950911441 ns/iter 1.08
JSON_Object_Defines_Miss_Too_Large 1.9835014109071545 ns/iter 1.7242903813651471 ns/iter 1.15
Pointer_Object_Traverse 55.89773331727832 ns/iter 51.60019459303983 ns/iter 1.08
Pointer_Object_Try_Traverse 39.796750061992654 ns/iter 35.70941709977653 ns/iter 1.11
Pointer_Push_Back_Pointer_To_Weak_Pointer 163.8380965136408 ns/iter 154.49149500064092 ns/iter 1.06
Schema_Frame_OMC_Full 244324366.2516276 ns/iter 190235733.98590088 ns/iter 1.28
Schema_Frame_OMC_References 108842713.49225725 ns/iter
Schema_Bundle_Meta_2020_12 5289475.707446828 ns/iter 8561454.16818014 ns/iter 0.62

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

Please sign in to comment.