Skip to content

Commit

Permalink
Remove anchors() from the public JSON Schema interface (#1500)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
  • Loading branch information
jviotti authored Jan 28, 2025
1 parent 2492e5e commit 3a44f00
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 682 deletions.
4 changes: 2 additions & 2 deletions src/core/jsonschema/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ include(./official_resolver.cmake)

sourcemeta_library(NAMESPACE sourcemeta PROJECT core NAME jsonschema
FOLDER "Core/JSON Schema"
PRIVATE_HEADERS anchor.h bundle.h resolver.h
PRIVATE_HEADERS bundle.h resolver.h
walker.h reference.h frame.h error.h unevaluated.h
keywords.h transform.h
SOURCES jsonschema.cc default_walker.cc frame.cc
anchor.cc resolver.cc walker.cc bundle.cc
resolver.cc walker.cc bundle.cc
unevaluated.cc relativize.cc unidentify.cc
transform_rule.cc transformer.cc
"${CMAKE_CURRENT_BINARY_DIR}/official_resolver.cc")
Expand Down
101 changes: 0 additions & 101 deletions src/core/jsonschema/anchor.cc

This file was deleted.

102 changes: 92 additions & 10 deletions src/core/jsonschema/frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,92 @@
#include <utility> // std::pair, std::move
#include <vector> // std::vector

enum class AnchorType : std::uint8_t { Static, Dynamic, All };

static auto find_anchors(const sourcemeta::core::JSON &schema,
const std::map<std::string, bool> &vocabularies)
-> std::map<std::string, AnchorType> {
std::map<std::string, AnchorType> result;

// 2020-12
if (schema.is_object() &&
vocabularies.contains(
"https://json-schema.org/draft/2020-12/vocab/core")) {
if (schema.defines("$dynamicAnchor")) {
const auto &anchor{schema.at("$dynamicAnchor")};
assert(anchor.is_string());
result.insert({anchor.to_string(), AnchorType::Dynamic});
}

if (schema.defines("$anchor")) {
const auto &anchor{schema.at("$anchor")};
assert(anchor.is_string());
const auto anchor_string{anchor.to_string()};
const auto success = result.insert({anchor_string, AnchorType::Static});
assert(success.second || result.contains(anchor_string));
if (!success.second) {
result[anchor_string] = AnchorType::All;
}
}
}

// 2019-09
if (schema.is_object() &&
vocabularies.contains(
"https://json-schema.org/draft/2019-09/vocab/core")) {
if (schema.defines("$recursiveAnchor")) {
const auto &anchor{schema.at("$recursiveAnchor")};
assert(anchor.is_boolean());
if (anchor.to_boolean()) {
// We store a 2019-09 recursive anchor as an empty anchor
result.insert({"", AnchorType::Dynamic});
}
}

if (schema.defines("$anchor")) {
const auto &anchor{schema.at("$anchor")};
assert(anchor.is_string());
const auto anchor_string{anchor.to_string()};
const auto success = result.insert({anchor_string, AnchorType::Static});
assert(success.second || result.contains(anchor_string));
if (!success.second) {
result[anchor_string] = AnchorType::All;
}
}
}

// Draft 7 and 6
// Old `$id` anchor form
if (schema.is_object() &&
(vocabularies.contains("http://json-schema.org/draft-07/schema#") ||
vocabularies.contains("http://json-schema.org/draft-06/schema#"))) {
if (schema.defines("$id")) {
assert(schema.at("$id").is_string());
const sourcemeta::core::URI identifier(schema.at("$id").to_string());
if (identifier.is_fragment_only()) {
result.insert(
{std::string{identifier.fragment().value()}, AnchorType::Static});
}
}
}

// Draft 4
// Old `id` anchor form
if (schema.is_object() &&
vocabularies.contains("http://json-schema.org/draft-04/schema#")) {
if (schema.defines("id")) {
assert(schema.at("id").is_string());
const sourcemeta::core::URI identifier(schema.at("id").to_string());
if (identifier.is_fragment_only()) {
result.insert(
{std::string{identifier.fragment().value()}, AnchorType::Static});
}
}
}

return result;
}

static auto find_nearest_bases(
const std::map<sourcemeta::core::Pointer, std::vector<std::string>> &bases,
const sourcemeta::core::Pointer &pointer,
Expand Down Expand Up @@ -254,26 +340,24 @@ auto internal_analyse(const sourcemeta::core::JSON &schema,
}

// Handle schema anchors
for (const auto &[name, type] : sourcemeta::core::anchors(
entry.common.value, entry.common.vocabularies)) {
for (const auto &[name, type] :
find_anchors(entry.common.value, entry.common.vocabularies)) {
const auto bases{
find_nearest_bases(base_uris, entry.common.pointer, entry.id)};

if (bases.first.empty()) {
const auto anchor_uri{sourcemeta::core::URI::from_fragment(name)};
const auto relative_anchor_uri{anchor_uri.recompose()};

if (type == sourcemeta::core::AnchorType::Static ||
type == sourcemeta::core::AnchorType::All) {
if (type == AnchorType::Static || type == AnchorType::All) {
store(frame, ReferenceType::Static, Frame::LocationType::Anchor,
relative_anchor_uri, root_id, "", entry.common.pointer,
entry.common.pointer.resolve_from(bases.second),
entry.common.dialect.value(),
entry.common.base_dialect.value());
}

if (type == sourcemeta::core::AnchorType::Dynamic ||
type == sourcemeta::core::AnchorType::All) {
if (type == AnchorType::Dynamic || type == AnchorType::All) {
store(frame, ReferenceType::Dynamic, Frame::LocationType::Anchor,
relative_anchor_uri, root_id, "", entry.common.pointer,
entry.common.pointer.resolve_from(bases.second),
Expand Down Expand Up @@ -310,8 +394,7 @@ auto internal_analyse(const sourcemeta::core::JSON &schema,
continue;
}

if (type == sourcemeta::core::AnchorType::Static ||
type == sourcemeta::core::AnchorType::All) {
if (type == AnchorType::Static || type == AnchorType::All) {
store(frame, sourcemeta::core::ReferenceType::Static,
Frame::LocationType::Anchor, anchor_uri, root_id, base_string,
entry.common.pointer,
Expand All @@ -320,8 +403,7 @@ auto internal_analyse(const sourcemeta::core::JSON &schema,
entry.common.base_dialect.value());
}

if (type == sourcemeta::core::AnchorType::Dynamic ||
type == sourcemeta::core::AnchorType::All) {
if (type == AnchorType::Dynamic || type == AnchorType::All) {
store(frame, sourcemeta::core::ReferenceType::Dynamic,
Frame::LocationType::Anchor, anchor_uri, root_id, base_string,
entry.common.pointer,
Expand Down
1 change: 0 additions & 1 deletion src/core/jsonschema/include/sourcemeta/core/jsonschema.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#endif

#include <sourcemeta/core/json.h>
#include <sourcemeta/core/jsonschema_anchor.h>
#include <sourcemeta/core/jsonschema_bundle.h>
#include <sourcemeta/core/jsonschema_error.h>
#include <sourcemeta/core/jsonschema_frame.h>
Expand Down
64 changes: 0 additions & 64 deletions src/core/jsonschema/include/sourcemeta/core/jsonschema_anchor.h

This file was deleted.

5 changes: 0 additions & 5 deletions test/jsonschema/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ sourcemeta_googletest(NAMESPACE sourcemeta PROJECT core NAME jsonschema
FOLDER "Core/JSON Schema"
SOURCES
jsonschema_test_utils.h
jsonschema_anchor_2020_12_test.cc
jsonschema_anchor_2019_09_test.cc
jsonschema_anchor_draft7_test.cc
jsonschema_anchor_draft6_test.cc
jsonschema_anchor_draft4_test.cc
jsonschema_identify_2020_12_test.cc
jsonschema_identify_2019_09_test.cc
jsonschema_identify_draft7_test.cc
Expand Down
Loading

5 comments on commit 3a44f00

@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: 3a44f00 Previous: 2492e5e Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.224490033782528 ns/iter 2.2111436203179213 ns/iter 1.01
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.2163196355636816 ns/iter 2.2001286520578116 ns/iter 1.01
Regex_Period_Asterisk 2.2185079225782487 ns/iter 2.2057711593449443 ns/iter 1.01
Regex_Group_Period_Asterisk_Group 2.205359675285626 ns/iter 2.210337333220009 ns/iter 1.00
Regex_Period_Plus 2.486167460822201 ns/iter 2.79860324518272 ns/iter 0.89
Regex_Period 2.486937337430677 ns/iter 2.54788068687906 ns/iter 0.98
Regex_Caret_Period_Plus_Dollar 2.486476594902778 ns/iter 2.4875050994454475 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 2.4867791056999358 ns/iter 2.4912739317001065 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 2.485293186770836 ns/iter 2.4883480211806366 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.4871802798846225 ns/iter 2.493770269034612 ns/iter 1.00
Regex_Caret_X_Hyphen 13.071042525060351 ns/iter 12.597373519372656 ns/iter 1.04
Regex_Period_Md_Dollar 82.24044383200162 ns/iter 81.67422130360217 ns/iter 1.01
Regex_Caret_Slash_Period_Asterisk 6.84216840074042 ns/iter 6.843664463370261 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 4.041864668114246 ns/iter 4.0398475021441325 ns/iter 1.00
Regex_Nested_Backtrack 505.2127239226588 ns/iter 498.2254229560972 ns/iter 1.01
JSON_Array_Of_Objects_Unique 405.4768926300942 ns/iter 406.11304843484015 ns/iter 1.00
JSON_Parse_1 31167.911377777575 ns/iter 30786.758918731128 ns/iter 1.01
JSON_Fast_Hash_Helm_Chart_Lock 59.383531041618156 ns/iter 59.25685805534612 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 171.2397544961988 ns/iter 151.41301910369856 ns/iter 1.13
JSON_String_Equal/10 7.7752848718545025 ns/iter 7.160517411943075 ns/iter 1.09
JSON_String_Equal/100 8.50185234479276 ns/iter 6.845516395241755 ns/iter 1.24
JSON_String_Equal_Small_By_Perfect_Hash/10 0.941722693074114 ns/iter 0.934837912853127 ns/iter 1.01
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 10.25828691430604 ns/iter 14.600103510376343 ns/iter 0.70
JSON_String_Fast_Hash/10 2.4902681971508445 ns/iter 2.503454074189386 ns/iter 0.99
JSON_String_Fast_Hash/100 2.487822424019786 ns/iter 2.5050830475110732 ns/iter 0.99
JSON_String_Key_Hash/10 2.180959647896586 ns/iter 2.6937836852284565 ns/iter 0.81
JSON_String_Key_Hash/100 1.869355881651737 ns/iter 1.8681956279413496 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.7409878595480266 ns/iter 3.733816782716067 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.737730820780923 ns/iter 3.739712942552505 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.7451223919619214 ns/iter 3.742022789103254 ns/iter 1.00
Pointer_Object_Traverse 44.474238504589096 ns/iter 44.38466385593775 ns/iter 1.00
Pointer_Object_Try_Traverse 52.335880487069396 ns/iter 52.70601072494114 ns/iter 0.99
Pointer_Push_Back_Pointer_To_Weak_Pointer 289.555656413328 ns/iter 307.89049472933414 ns/iter 0.94

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

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (macos/llvm)

Benchmark suite Current: 3a44f00 Previous: 2492e5e Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.6869035225838502 ns/iter 1.8856189495513693 ns/iter 0.89
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.6717425280621576 ns/iter 1.8246839608306262 ns/iter 0.92
Regex_Period_Asterisk 1.7315909542226087 ns/iter 1.7459228306283452 ns/iter 0.99
Regex_Group_Period_Asterisk_Group 1.5971479580792445 ns/iter 1.8851535171730374 ns/iter 0.85
Regex_Period_Plus 1.9851353312519882 ns/iter 2.2013061320227347 ns/iter 0.90
Regex_Period 1.987003552880149 ns/iter 2.2129030761107624 ns/iter 0.90
Regex_Caret_Period_Plus_Dollar 2.0360228609038016 ns/iter 2.244911830670867 ns/iter 0.91
Regex_Caret_Group_Period_Plus_Group_Dollar 2.0155546536548052 ns/iter 2.209557324259319 ns/iter 0.91
Regex_Caret_Period_Asterisk_Dollar 1.7810159309933116 ns/iter 1.7944728936234418 ns/iter 0.99
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.8130581009595539 ns/iter 1.8014461381733193 ns/iter 1.01
Regex_Caret_X_Hyphen 7.626872528480537 ns/iter 7.570363466811086 ns/iter 1.01
Regex_Period_Md_Dollar 78.60826172541992 ns/iter 76.93690568019085 ns/iter 1.02
Regex_Caret_Slash_Period_Asterisk 5.692941079132538 ns/iter 5.727159036181991 ns/iter 0.99
Regex_Caret_Period_Range_Dollar 2.4680798922526663 ns/iter 2.5548133291273087 ns/iter 0.97
Regex_Nested_Backtrack 814.5975485414334 ns/iter 859.1831207286483 ns/iter 0.95
JSON_Array_Of_Objects_Unique 386.12357970750475 ns/iter 447.81650535816374 ns/iter 0.86
JSON_Parse_1 28793.78459546728 ns/iter 30876.821651626935 ns/iter 0.93
JSON_Fast_Hash_Helm_Chart_Lock 70.8878583613185 ns/iter 55.259665399347824 ns/iter 1.28
JSON_Equality_Helm_Chart_Lock 148.21819122903514 ns/iter 140.5083316921428 ns/iter 1.05
JSON_String_Equal/10 8.797447069798388 ns/iter 8.619044765911262 ns/iter 1.02
JSON_String_Equal/100 7.182115985197278 ns/iter 6.653917902452342 ns/iter 1.08
JSON_String_Equal_Small_By_Perfect_Hash/10 0.34854794902482716 ns/iter 0.3534960799707045 ns/iter 0.99
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.2639696243637744 ns/iter 3.2694905305951947 ns/iter 1.00
JSON_String_Fast_Hash/10 1.7446227372568068 ns/iter 1.7159200151970297 ns/iter 1.02
JSON_String_Fast_Hash/100 2.1209546876042005 ns/iter 2.0696467778598624 ns/iter 1.02
JSON_String_Key_Hash/10 1.423988126096835 ns/iter 1.424595785921619 ns/iter 1.00
JSON_String_Key_Hash/100 1.430695725077948 ns/iter 1.4568338982300413 ns/iter 0.98
JSON_Object_Defines_Miss_Same_Length 2.7856325555331063 ns/iter 2.4083469720437387 ns/iter 1.16
JSON_Object_Defines_Miss_Too_Small 2.8433110637269245 ns/iter 2.5330610466434655 ns/iter 1.12
JSON_Object_Defines_Miss_Too_Large 2.406699967161364 ns/iter 2.5572955262271204 ns/iter 0.94
Pointer_Object_Traverse 17.58466030243771 ns/iter 18.80521106237539 ns/iter 0.94
Pointer_Object_Try_Traverse 22.5665462574543 ns/iter 24.51805309608182 ns/iter 0.92
Pointer_Push_Back_Pointer_To_Weak_Pointer 185.86409612404606 ns/iter 204.3824141833214 ns/iter 0.91

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: 3a44f00 Previous: 2492e5e Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 7.190870057183948 ns/iter 7.108755580357443 ns/iter 1.01
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 6.897811383930832 ns/iter 7.161896205357518 ns/iter 0.96
Regex_Period_Asterisk 6.950489955358361 ns/iter 6.911620535713528 ns/iter 1.01
Regex_Group_Period_Asterisk_Group 7.074734374999789 ns/iter 6.9880392857147715 ns/iter 1.01
Regex_Period_Plus 7.663383928570815 ns/iter 7.430243303572226 ns/iter 1.03
Regex_Period 7.804609786586284 ns/iter 7.182187500000785 ns/iter 1.09
Regex_Caret_Period_Plus_Dollar 7.256041294641286 ns/iter 7.1994531249990645 ns/iter 1.01
Regex_Caret_Group_Period_Plus_Group_Dollar 7.429072734691383 ns/iter 7.207620535713792 ns/iter 1.03
Regex_Caret_Period_Asterisk_Dollar 7.28472544642906 ns/iter 7.026176339285531 ns/iter 1.04
Regex_Caret_Group_Period_Asterisk_Group_Dollar 7.050293526784657 ns/iter 7.219255580357091 ns/iter 0.98
Regex_Caret_X_Hyphen 11.776105357142798 ns/iter 14.278049936259428 ns/iter 0.82
Regex_Period_Md_Dollar 156.65799107143891 ns/iter 152.09018963881627 ns/iter 1.03
Regex_Caret_Slash_Period_Asterisk 10.271101785714825 ns/iter 11.128717857143247 ns/iter 0.92
Regex_Caret_Period_Range_Dollar 7.8812651433870675 ns/iter 7.540963169642621 ns/iter 1.05
Regex_Nested_Backtrack 620.1635714284797 ns/iter 607.2477678571125 ns/iter 1.02
JSON_Array_Of_Objects_Unique 489.0600424450617 ns/iter 489.9271430657531 ns/iter 1.00
JSON_Parse_1 79714.20758930188 ns/iter 79816.39212535575 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 63.738330000001035 ns/iter 63.03219642857373 ns/iter 1.01
JSON_Equality_Helm_Chart_Lock 187.25122012841223 ns/iter 189.78781158817978 ns/iter 0.99
JSON_String_Equal/10 9.056513798855478 ns/iter 9.000257812500832 ns/iter 1.01
JSON_String_Equal/100 9.943690134181171 ns/iter 9.913895045027719 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 2.170392812499955 ns/iter 2.167986250000098 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 15.368949244366608 ns/iter 14.560082589285223 ns/iter 1.06
JSON_String_Fast_Hash/10 4.02566764111716 ns/iter 4.022034605396982 ns/iter 1.00
JSON_String_Fast_Hash/100 4.027774917906397 ns/iter 4.02836514112216 ns/iter 1.00
JSON_String_Key_Hash/10 7.875758928572095 ns/iter 7.852272286374367 ns/iter 1.00
JSON_String_Key_Hash/100 4.038916614356162 ns/iter 4.023891167899767 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.7167048147920396 ns/iter 3.7200246362141582 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 4.951602999999523 ns/iter 4.9560250000001815 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.408688342127898 ns/iter 3.417769726039712 ns/iter 1.00
Pointer_Object_Traverse 49.0120799999886 ns/iter 49.184649999995145 ns/iter 1.00
Pointer_Object_Try_Traverse 67.64337499999687 ns/iter 67.87433035714433 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 184.40942717939004 ns/iter 160.0469866071208 ns/iter 1.15

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: 3a44f00 Previous: 2492e5e Ratio
Pointer_Object_Traverse 47.65269441927692 ns/iter 45.840627853949435 ns/iter 1.04
Pointer_Object_Try_Traverse 26.1349753645266 ns/iter 26.13607518815556 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 145.5356679245723 ns/iter 144.85669455980258 ns/iter 1.00
JSON_Array_Of_Objects_Unique 410.9426964067779 ns/iter 412.2524304452254 ns/iter 1.00
JSON_Parse_1 33462.92860899699 ns/iter 33405.22089953349 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 62.873291688469 ns/iter 62.57066824892936 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 151.06016473000122 ns/iter 149.4381260936381 ns/iter 1.01
JSON_String_Equal/10 6.342003897248392 ns/iter 6.340375580264439 ns/iter 1.00
JSON_String_Equal/100 6.981182361428334 ns/iter 6.966305243569889 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9345955026978608 ns/iter 0.9334189157887778 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.293382316785056 ns/iter 14.298650704286915 ns/iter 1.00
JSON_String_Fast_Hash/10 0.9331333904774174 ns/iter 0.9448569344788444 ns/iter 0.99
JSON_String_Fast_Hash/100 0.9384293037119047 ns/iter 0.9541443095919708 ns/iter 0.98
JSON_String_Key_Hash/10 1.6707210419138558 ns/iter 1.6717275696396303 ns/iter 1.00
JSON_String_Key_Hash/100 1.9824588160324201 ns/iter 1.983720797669898 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 2.4864044920162702 ns/iter 2.545532506863017 ns/iter 0.98
JSON_Object_Defines_Miss_Too_Small 2.487712784056823 ns/iter 2.49058532051174 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.1072782873109723 ns/iter 3.1181990105767974 ns/iter 1.00
Regex_Lower_S_Or_Upper_S_Asterisk 3.4187148016600792 ns/iter 3.4219505498981047 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 3.433751878410639 ns/iter 3.444012936817582 ns/iter 1.00
Regex_Period_Asterisk 3.421097900087504 ns/iter 3.4289215138699936 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 3.443963975751735 ns/iter 3.420869897340437 ns/iter 1.01
Regex_Period_Plus 3.7298673202767745 ns/iter 3.741909129075417 ns/iter 1.00
Regex_Period 3.728402058584454 ns/iter 3.728190787663804 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 3.731126926739495 ns/iter 3.7287556000011817 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 3.729506697457363 ns/iter 3.7288022313854174 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 4.658974492385322 ns/iter 4.6624720066537355 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 4.660909669722313 ns/iter 4.671795372669684 ns/iter 1.00
Regex_Caret_X_Hyphen 13.069584972112253 ns/iter 12.433011596993488 ns/iter 1.05
Regex_Period_Md_Dollar 89.95689194978954 ns/iter 88.81716107595766 ns/iter 1.01
Regex_Caret_Slash_Period_Asterisk 8.083109476813025 ns/iter 8.080493550850028 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 4.660677650612457 ns/iter 4.665831623094242 ns/iter 1.00
Regex_Nested_Backtrack 828.7841155166956 ns/iter 818.4269600015867 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: 3a44f00 Previous: 2492e5e Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.0379328918072175 ns/iter 2.026600767951069 ns/iter 1.01
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.0361142627987583 ns/iter 2.079071925094296 ns/iter 0.98
Regex_Period_Asterisk 2.0987442978945574 ns/iter 2.009437282351249 ns/iter 1.04
Regex_Group_Period_Asterisk_Group 2.0353534665302773 ns/iter 1.9704979943229592 ns/iter 1.03
Regex_Period_Plus 2.031408390799496 ns/iter 1.9963061784457965 ns/iter 1.02
Regex_Period 2.017677895346648 ns/iter 2.0208231926398756 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 2.033382121101866 ns/iter 2.055018419848769 ns/iter 0.99
Regex_Caret_Group_Period_Plus_Group_Dollar 2.037947366511367 ns/iter 2.0435971677945113 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 2.022677054892075 ns/iter 2.0052680676414862 ns/iter 1.01
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.3578196785253507 ns/iter 2.3539794063396373 ns/iter 1.00
Regex_Caret_X_Hyphen 6.472651582566345 ns/iter 6.434392888215279 ns/iter 1.01
Regex_Period_Md_Dollar 73.55183719799044 ns/iter 74.8030893008348 ns/iter 0.98
Regex_Caret_Slash_Period_Asterisk 4.73106125101573 ns/iter 4.669338381029344 ns/iter 1.01
Regex_Caret_Period_Range_Dollar 2.0651391833391317 ns/iter 2.077835856775558 ns/iter 0.99
Regex_Nested_Backtrack 880.7580448587958 ns/iter 880.0238996168044 ns/iter 1.00
JSON_Array_Of_Objects_Unique 225.0275811596015 ns/iter 237.0036123475368 ns/iter 0.95
JSON_Parse_1 28440.359345994275 ns/iter 25509.622509919067 ns/iter 1.11
JSON_Fast_Hash_Helm_Chart_Lock 26.693127658581098 ns/iter 26.654392013281743 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 122.0241275033822 ns/iter 124.7035009488768 ns/iter 0.98
JSON_String_Equal/10 5.805640549202992 ns/iter 6.135770671134114 ns/iter 0.95
JSON_String_Equal/100 5.698044275313943 ns/iter 5.548843530010463 ns/iter 1.03
JSON_String_Equal_Small_By_Perfect_Hash/10 0.8077840838958594 ns/iter 0.8206788841898318 ns/iter 0.98
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.7330192388891823 ns/iter 3.7865099879272117 ns/iter 0.99
JSON_String_Fast_Hash/10 2.054200506416629 ns/iter 2.046332388426806 ns/iter 1.00
JSON_String_Fast_Hash/100 2.056108633137606 ns/iter 2.0703781023923953 ns/iter 0.99
JSON_String_Key_Hash/10 1.5502688306856098 ns/iter 1.57251345832712 ns/iter 0.99
JSON_String_Key_Hash/100 2.0699706951794954 ns/iter 2.121870257146912 ns/iter 0.98
JSON_Object_Defines_Miss_Same_Length 1.8570757302744108 ns/iter 1.8715366193755891 ns/iter 0.99
JSON_Object_Defines_Miss_Too_Small 2.0214743949480414 ns/iter 2.101276302125172 ns/iter 0.96
JSON_Object_Defines_Miss_Too_Large 1.8710601381824672 ns/iter 2.0327701402503022 ns/iter 0.92
Pointer_Object_Traverse 57.915578368698284 ns/iter 60.30684480203827 ns/iter 0.96
Pointer_Object_Try_Traverse 38.77973408532813 ns/iter 37.79610067356233 ns/iter 1.03
Pointer_Push_Back_Pointer_To_Weak_Pointer 169.95327395678524 ns/iter 189.26061572963368 ns/iter 0.90

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

Please sign in to comment.