Skip to content

Implement a helper to check equality of JSON object keys#2546

Merged
jviotti merged 1 commit into
mainfrom
key-equals
Jun 27, 2026
Merged

Implement a helper to check equality of JSON object keys#2546
jviotti merged 1 commit into
mainfrom
key-equals

Conversation

@jviotti

@jviotti jviotti commented Jun 27, 2026

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Review in cubic

@augmentcode

augmentcode Bot commented Jun 27, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Adds a small helper on JSON object entries to compare keys efficiently using precomputed hashes.

Changes:

  • Introduced JSONObject::Entry::key_equals(KeyView, hash_type) to check hash equality first and skip string comparison when the hash is known to be perfect.
  • Added unit tests covering perfect-hash matches/mismatches, imperfect-hash matches, and imperfect-hash collision rejection.

Technical Notes: The helper mirrors the object lookup strategy (hash-first; string-compare only when necessary) to support faster key comparisons when a hash is already available.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

[[nodiscard]] inline auto key_equals(const KeyView key,
const hash_type key_hash) const
-> bool {
return this->hash == key_hash &&

@augmentcode augmentcode Bot Jun 27, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

src/core/json/include/sourcemeta/core/json_object.h:58: key_equals can return a false positive if a caller accidentally passes a key_hash that doesn’t correspond to the provided key (especially in the is_perfect case where the string comparison is skipped). Other APIs that accept a precomputed hash typically assert(hash(key) == key_hash), so it may be worth adding a similar defensive check here to catch misuse in debug builds.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/core/json/include/sourcemeta/core/json_object.h

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Benchmark (macos/llvm)

Details
Benchmark suite Current: ddc8579 Previous: 3f61ec7 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.8163403216071234 ns/iter 1.5721878253893549 ns/iter 1.16
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.8760818511865909 ns/iter 1.5709365918904195 ns/iter 1.19
Regex_Period_Asterisk 1.8666830215142254 ns/iter 1.580877909805482 ns/iter 1.18
Regex_Group_Period_Asterisk_Group 1.9063943532233703 ns/iter 1.61013912306068 ns/iter 1.18
Regex_Period_Plus 2.5723611157682353 ns/iter 1.884616268747851 ns/iter 1.36
Regex_Period 2.5798801511265927 ns/iter 1.9231744215311526 ns/iter 1.34
Regex_Caret_Period_Plus_Dollar 2.197040579900206 ns/iter 1.8849050673642156 ns/iter 1.17
Regex_Caret_Group_Period_Plus_Group_Dollar 2.218310023399606 ns/iter 1.9229057209590745 ns/iter 1.15
Regex_Caret_Period_Asterisk_Dollar 1.8380833667998269 ns/iter 1.577417574451586 ns/iter 1.17
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.7736290247199356 ns/iter 1.6097708680010907 ns/iter 1.10
Regex_Caret_X_Hyphen 6.184834087595666 ns/iter 5.684823554791662 ns/iter 1.09
Regex_Period_Md_Dollar 18.659384282856248 ns/iter 16.04687276531541 ns/iter 1.16
Regex_Caret_Slash_Period_Asterisk 5.001436669999748 ns/iter 4.106069594596859 ns/iter 1.22
Regex_Caret_Period_Range_Dollar 2.1414412019853293 ns/iter 1.9029558685852863 ns/iter 1.13
Regex_Nested_Backtrack 27.62052048976831 ns/iter 24.71606484513432 ns/iter 1.12
JSON_Array_Of_Objects_Unique 381.53103466816856 ns/iter 317.2918597088014 ns/iter 1.20
JSON_Parse_1 3902.7127711434596 ns/iter 3375.1732653937465 ns/iter 1.16
JSON_Parse_Real 6589.505244211788 ns/iter 4853.724332094555 ns/iter 1.36
JSON_Parse_Decimal 7529.480940381247 ns/iter 5201.8428014735955 ns/iter 1.45
JSON_Parse_Schema_ISO_Language 4749994.260869836 ns/iter 3525605.490908261 ns/iter 1.35
JSON_Parse_Integer 3188.882870111424 ns/iter 2798.217708883932 ns/iter 1.14
JSON_Parse_String_NonSSO_Plain 3829.379514007445 ns/iter 3688.056852926367 ns/iter 1.04
JSON_Parse_String_SSO_Plain 1910.494610109275 ns/iter 1687.537714441717 ns/iter 1.13
JSON_Parse_String_Escape_Heavy 17371.320193571348 ns/iter 15242.696583513763 ns/iter 1.14
JSON_Parse_Object_Short_Keys 5731.579819196577 ns/iter 4850.8091450741795 ns/iter 1.18
JSON_Parse_Object_Scalar_Properties 2964.1571645735767 ns/iter 2750.8525645968034 ns/iter 1.08
JSON_Parse_Object_Array_Properties 3522.3319148494265 ns/iter 3380.7632803706965 ns/iter 1.04
JSON_Parse_Object_Object_Properties 4009.915472957915 ns/iter 3274.968758316761 ns/iter 1.22
JSON_Parse_Nested_Containers 29093.971074902416 ns/iter 25848.732305202153 ns/iter 1.13
JSON_From_String_Copy 30.420795019415547 ns/iter 22.693522120261402 ns/iter 1.34
JSON_From_String_Temporary 22.09508242711677 ns/iter 18.7520092022192 ns/iter 1.18
JSON_Number_To_Double 36.391872975597366 ns/iter 30.833146026892145 ns/iter 1.18
JSON_Object_At_Last_Key/8 3.9329351396758474 ns/iter 3.465958715014786 ns/iter 1.13
JSON_Object_At_Last_Key/32 12.60811600567695 ns/iter 11.000988690049889 ns/iter 1.15
JSON_Object_At_Last_Key/128 57.729273516411894 ns/iter 50.61801191573092 ns/iter 1.14
JSON_Object_At_Last_Key/512 194.35511825318338 ns/iter 186.2545816232497 ns/iter 1.04
JSON_Fast_Hash_Helm_Chart_Lock 63.014944671962816 ns/iter 57.2105872054974 ns/iter 1.10
JSON_Equality_Helm_Chart_Lock 147.91760007223658 ns/iter 124.36810149048968 ns/iter 1.19
JSON_Divisible_By_Decimal 182.60800792914483 ns/iter 163.10938979613167 ns/iter 1.12
JSON_String_Equal/10 7.057649196129691 ns/iter 6.46326371996207 ns/iter 1.09
JSON_String_Equal/100 7.035856689149482 ns/iter 6.287952231952752 ns/iter 1.12
JSON_String_Equal_Small_By_Perfect_Hash/10 0.8421030476991909 ns/iter 0.7152264647580686 ns/iter 1.18
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.912685854827701 ns/iter 3.207136129302806 ns/iter 1.22
JSON_String_Fast_Hash/10 2.510133176679929 ns/iter 2.213466415029522 ns/iter 1.13
JSON_String_Fast_Hash/100 2.190844474504854 ns/iter 1.8862174073576436 ns/iter 1.16
JSON_String_Key_Hash/10 1.4895025776750639 ns/iter 1.285487761730803 ns/iter 1.16
JSON_String_Key_Hash/100 2.313658656805544 ns/iter 2.0278319808029 ns/iter 1.14
JSON_Object_Defines_Miss_Same_Length 2.560872160632054 ns/iter 2.2021516190190886 ns/iter 1.16
JSON_Object_Defines_Miss_Too_Small 2.635503946995136 ns/iter 2.2986531736745897 ns/iter 1.15
JSON_Object_Defines_Miss_Too_Large 2.4753396082069563 ns/iter 2.2036714235525636 ns/iter 1.12
Pointer_Object_Traverse 15.113347582085282 ns/iter 12.829196182794346 ns/iter 1.18
Pointer_Object_Try_Traverse 25.613414539610037 ns/iter 21.52188113655022 ns/iter 1.19
Pointer_Push_Back_Pointer_To_Weak_Pointer 169.47929218397573 ns/iter 143.3239877230652 ns/iter 1.18
Pointer_Walker_Schema_ISO_Language 2753114.3617017013 ns/iter 2288723.346368872 ns/iter 1.20
Pointer_Maybe_Tracked_Deeply_Nested/0 1346903.57662811 ns/iter 799760.0059736286 ns/iter 1.68
Pointer_Maybe_Tracked_Deeply_Nested/1 1924867.1448089168 ns/iter 1068185.4015035098 ns/iter 1.80
Pointer_Position_Tracker_Get_Deeply_Nested 368.8210727639338 ns/iter 331.3426355590464 ns/iter 1.11
URITemplateRouter_Create 24792.777392392094 ns/iter 21407.994923853716 ns/iter 1.16
URITemplateRouter_Match 169.85116080778351 ns/iter 150.75018037118028 ns/iter 1.13
URITemplateRouter_Match_BasePath 190.69469846719818 ns/iter 180.7087327978985 ns/iter 1.06
URITemplateRouterView_Restore 10663.700189548903 ns/iter 9902.772174807285 ns/iter 1.08
URITemplateRouterView_Match 151.67120197616921 ns/iter 120.39173216824693 ns/iter 1.26
URITemplateRouterView_Match_BasePath 150.70086560281746 ns/iter 137.55076802285302 ns/iter 1.10
URITemplateRouterView_Arguments 451.6183978318689 ns/iter 374.8631242675623 ns/iter 1.20
JSONL_Parse_Large 13313457.589289004 ns/iter 11453308.737704678 ns/iter 1.16
JSONL_Parse_Large_GZIP 13705406.46938916 ns/iter 12765654.228069091 ns/iter 1.07
HTML_Build_Table_100000 83763734.37499751 ns/iter 59760862.50002482 ns/iter 1.40
HTML_Render_Table_100000 5696315.429629437 ns/iter 2333172.675408888 ns/iter 2.44
GZIP_Compress_ISO_Language_Set_3_Locations 32747877.050007902 ns/iter 24777611.607143108 ns/iter 1.32
GZIP_Decompress_ISO_Language_Set_3_Locations 6430392.699115072 ns/iter 5062338.329998965 ns/iter 1.27
GZIP_Compress_ISO_Language_Set_3_Schema 1718487.8952380563 ns/iter 1396744.1309522842 ns/iter 1.23
GZIP_Decompress_ISO_Language_Set_3_Schema 292702.8281975366 ns/iter 260848.10183519725 ns/iter 1.12
JOSE_VerifySignature_RS256 23288.113567178163 ns/iter 20352.24351808495 ns/iter 1.14
JOSE_VerifySignature_ES512 1151228.8288285416 ns/iter 915597.2577716899 ns/iter 1.26

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Benchmark (linux/gcc)

Details
Benchmark suite Current: ddc8579 Previous: 3f61ec7 Ratio
JOSE_VerifySignature_RS256 22220.49114342291 ns/iter 21710.217361045092 ns/iter 1.02
JOSE_VerifySignature_ES512 576343.2612982217 ns/iter 540169.5362096134 ns/iter 1.07
GZIP_Compress_ISO_Language_Set_3_Locations 36797507.894735456 ns/iter 30943056.636364087 ns/iter 1.19
GZIP_Decompress_ISO_Language_Set_3_Locations 4455561.62986952 ns/iter 4951894.2910448965 ns/iter 0.90
GZIP_Compress_ISO_Language_Set_3_Schema 2048030.4122805812 ns/iter 1987202.0740738928 ns/iter 1.03
GZIP_Decompress_ISO_Language_Set_3_Schema 380136.89490791364 ns/iter 347853.96862552065 ns/iter 1.09
HTML_Build_Table_100000 61258687.54545329 ns/iter 59513327.00000004 ns/iter 1.03
HTML_Render_Table_100000 2049350.1720117473 ns/iter 3008439.607929637 ns/iter 0.68
JSONL_Parse_Large 13241091.320754282 ns/iter 12089100.32758679 ns/iter 1.10
JSONL_Parse_Large_GZIP 14648219.583333364 ns/iter 13407370.865385596 ns/iter 1.09
URITemplateRouter_Create 30064.006006781667 ns/iter 27377.006072712855 ns/iter 1.10
URITemplateRouter_Match 155.69304088512482 ns/iter 143.4274721943074 ns/iter 1.09
URITemplateRouter_Match_BasePath 179.96786012931517 ns/iter 163.77221482839158 ns/iter 1.10
URITemplateRouterView_Restore 8137.075519201478 ns/iter 3390.1151686907456 ns/iter 2.40
URITemplateRouterView_Match 125.54225372337763 ns/iter 117.71100490315837 ns/iter 1.07
URITemplateRouterView_Match_BasePath 142.56748549328154 ns/iter 132.3784981728773 ns/iter 1.08
URITemplateRouterView_Arguments 474.75918512439347 ns/iter 528.8835035017332 ns/iter 0.90
Pointer_Object_Traverse 29.170247784751847 ns/iter 29.52621503562239 ns/iter 0.99
Pointer_Object_Try_Traverse 23.27071813277525 ns/iter 24.026833391220578 ns/iter 0.97
Pointer_Push_Back_Pointer_To_Weak_Pointer 148.18947956290054 ns/iter 174.08780892610596 ns/iter 0.85
Pointer_Walker_Schema_ISO_Language 1966977.9326145947 ns/iter 1731307.5224998898 ns/iter 1.14
Pointer_Maybe_Tracked_Deeply_Nested/0 1680880.0392155657 ns/iter 1557919.295555621 ns/iter 1.08
Pointer_Maybe_Tracked_Deeply_Nested/1 1689980.3894230123 ns/iter 1977562.0769230803 ns/iter 0.85
Pointer_Position_Tracker_Get_Deeply_Nested 615.6216550584805 ns/iter 507.6929391509102 ns/iter 1.21
JSON_Array_Of_Objects_Unique 411.7592576569239 ns/iter 321.5538770671066 ns/iter 1.28
JSON_Parse_1 7582.443013212616 ns/iter 6771.493190435813 ns/iter 1.12
JSON_Parse_Real 6620.012009561671 ns/iter 5897.145897855222 ns/iter 1.12
JSON_Parse_Decimal 11279.347216183713 ns/iter 9203.3182898184 ns/iter 1.23
JSON_Parse_Schema_ISO_Language 5156064.556391166 ns/iter 4730925.800000326 ns/iter 1.09
JSON_Parse_Integer 4901.336502698517 ns/iter 4749.744521337465 ns/iter 1.03
JSON_Parse_String_NonSSO_Plain 8674.17643257532 ns/iter 7497.786312266783 ns/iter 1.16
JSON_Parse_String_SSO_Plain 3940.9514679079043 ns/iter 3568.7021600136936 ns/iter 1.10
JSON_Parse_String_Escape_Heavy 21290.06330530579 ns/iter 19580.193426889335 ns/iter 1.09
JSON_Parse_Object_Short_Keys 14117.010055263314 ns/iter 9944.011576970779 ns/iter 1.42
JSON_Parse_Object_Scalar_Properties 5829.459329704146 ns/iter 5102.242084048748 ns/iter 1.14
JSON_Parse_Object_Array_Properties 8637.710276103282 ns/iter 7696.29149940375 ns/iter 1.12
JSON_Parse_Object_Object_Properties 9244.897969004372 ns/iter 7890.76996373227 ns/iter 1.17
JSON_Parse_Nested_Containers 71220.47009764628 ns/iter 64610.49373156745 ns/iter 1.10
JSON_From_String_Copy 18.965461824016447 ns/iter 15.55581792627575 ns/iter 1.22
JSON_From_String_Temporary 15.355604531792087 ns/iter 13.603176183250207 ns/iter 1.13
JSON_Number_To_Double 20.648989151060928 ns/iter 19.07074730835827 ns/iter 1.08
JSON_Object_At_Last_Key/8 8.112436126035286 ns/iter 8.115357634160988 ns/iter 1.00
JSON_Object_At_Last_Key/32 31.60045620103597 ns/iter 28.865824822097505 ns/iter 1.09
JSON_Object_At_Last_Key/128 127.01541044395158 ns/iter 118.78368574225149 ns/iter 1.07
JSON_Object_At_Last_Key/512 526.3853271552157 ns/iter 451.390445809715 ns/iter 1.17
JSON_Fast_Hash_Helm_Chart_Lock 67.2535049464137 ns/iter 48.18878740141787 ns/iter 1.40
JSON_Equality_Helm_Chart_Lock 157.28389403314802 ns/iter 137.1506396700914 ns/iter 1.15
JSON_Divisible_By_Decimal 239.2229385565765 ns/iter 248.24203255052663 ns/iter 0.96
JSON_String_Equal/10 6.316160185034283 ns/iter 5.587645609977195 ns/iter 1.13
JSON_String_Equal/100 6.941657078035686 ns/iter 6.744445989875781 ns/iter 1.03
JSON_String_Equal_Small_By_Perfect_Hash/10 0.6239289900263603 ns/iter 0.825259872317499 ns/iter 0.76
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 25.2040826232447 ns/iter 16.99372094552088 ns/iter 1.48
JSON_String_Fast_Hash/10 1.2465924921362113 ns/iter 1.442360836735323 ns/iter 0.86
JSON_String_Fast_Hash/100 1.2467684351392567 ns/iter 1.4411034194382142 ns/iter 0.87
JSON_String_Key_Hash/10 1.246874199185067 ns/iter 1.1529801780778843 ns/iter 1.08
JSON_String_Key_Hash/100 12.444356564237095 ns/iter 11.825951270328408 ns/iter 1.05
JSON_Object_Defines_Miss_Same_Length 3.11567691752349 ns/iter 3.356788849402276 ns/iter 0.93
JSON_Object_Defines_Miss_Too_Small 3.1133915074436143 ns/iter 3.1859872193082266 ns/iter 0.98
JSON_Object_Defines_Miss_Too_Large 3.4287970398932677 ns/iter 3.458568551755549 ns/iter 0.99
Regex_Lower_S_Or_Upper_S_Asterisk 0.622620751636526 ns/iter 0.8673585063582342 ns/iter 0.72
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 0.933706684804159 ns/iter 1.1516376728412985 ns/iter 0.81
Regex_Period_Asterisk 0.9353588136646274 ns/iter 1.152518105518464 ns/iter 0.81
Regex_Group_Period_Asterisk_Group 0.6279126656137719 ns/iter 0.864074972836353 ns/iter 0.73
Regex_Period_Plus 0.6276655214187006 ns/iter 0.8646674506677084 ns/iter 0.73
Regex_Period 0.9361862097758511 ns/iter 1.1524236343411405 ns/iter 0.81
Regex_Caret_Period_Plus_Dollar 0.9347097719292505 ns/iter 1.152039211547738 ns/iter 0.81
Regex_Caret_Group_Period_Plus_Group_Dollar 0.6230835587892226 ns/iter 0.8641495829337829 ns/iter 0.72
Regex_Caret_Period_Asterisk_Dollar 0.6229239594605344 ns/iter 0.8656592089724753 ns/iter 0.72
Regex_Caret_Group_Period_Asterisk_Group_Dollar 0.9341829292076477 ns/iter 1.151994709991765 ns/iter 0.81
Regex_Caret_X_Hyphen 4.05226494875008 ns/iter 3.1682622929292683 ns/iter 1.28
Regex_Period_Md_Dollar 29.144302384421817 ns/iter 23.295326369983297 ns/iter 1.25
Regex_Caret_Slash_Period_Asterisk 4.35973372749045 ns/iter 3.1683525157459504 ns/iter 1.38
Regex_Caret_Period_Range_Dollar 1.2467259825963795 ns/iter 1.4402717654060921 ns/iter 0.87
Regex_Nested_Backtrack 36.43522355958649 ns/iter 33.85692711019911 ns/iter 1.08

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Benchmark (linux/llvm)

Details
Benchmark suite Current: ddc8579 Previous: 3f61ec7 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.180647786994523 ns/iter 2.2422351927282573 ns/iter 0.97
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.179544574563641 ns/iter 2.186650689788132 ns/iter 1.00
Regex_Period_Asterisk 2.179396728207127 ns/iter 2.2154706125169614 ns/iter 0.98
Regex_Group_Period_Asterisk_Group 2.179748286253621 ns/iter 2.1921398706645134 ns/iter 0.99
Regex_Period_Plus 2.4905300529093317 ns/iter 2.4897195834529273 ns/iter 1.00
Regex_Period 2.4892090710949177 ns/iter 2.4899823865049973 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 2.8002998446923106 ns/iter 2.81860787397541 ns/iter 0.99
Regex_Caret_Group_Period_Plus_Group_Dollar 2.8013014602949777 ns/iter 2.801411478765485 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 3.1099567674032973 ns/iter 3.110604625321744 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.109675173122625 ns/iter 3.1104840521212043 ns/iter 1.00
Regex_Caret_X_Hyphen 6.989643173833476 ns/iter 7.469012174712327 ns/iter 0.94
Regex_Period_Md_Dollar 32.239431682115566 ns/iter 32.3744047578325 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 6.846815290227856 ns/iter 5.9123696997197195 ns/iter 1.16
Regex_Caret_Period_Range_Dollar 3.2781724497922475 ns/iter 3.734627667622642 ns/iter 0.88
Regex_Nested_Backtrack 59.05917004438394 ns/iter 59.82831735989822 ns/iter 0.99
JSON_Array_Of_Objects_Unique 404.16557747428527 ns/iter 404.1707456566681 ns/iter 1.00
JSON_Parse_1 4896.937729397244 ns/iter 4896.070988466431 ns/iter 1.00
JSON_Parse_Real 5444.831243720144 ns/iter 5359.3495890072945 ns/iter 1.02
JSON_Parse_Decimal 7962.115885402165 ns/iter 7723.828390367852 ns/iter 1.03
JSON_Parse_Schema_ISO_Language 3444073.228855411 ns/iter 3465674.41089134 ns/iter 0.99
JSON_Parse_Integer 3645.7889406759195 ns/iter 3717.418433419837 ns/iter 0.98
JSON_Parse_String_NonSSO_Plain 5001.394490000166 ns/iter 4920.9225055913275 ns/iter 1.02
JSON_Parse_String_SSO_Plain 2699.045575632202 ns/iter 2717.2450659042893 ns/iter 0.99
JSON_Parse_String_Escape_Heavy 14241.66086299598 ns/iter 14183.596140230877 ns/iter 1.00
JSON_Parse_Object_Short_Keys 8144.886415658967 ns/iter 10858.031896070377 ns/iter 0.75
JSON_Parse_Object_Scalar_Properties 4164.201745647836 ns/iter 4094.700150451749 ns/iter 1.02
JSON_Parse_Object_Array_Properties 5803.1359381868 ns/iter 5746.937059779442 ns/iter 1.01
JSON_Parse_Object_Object_Properties 5626.714305275283 ns/iter 5562.433433242201 ns/iter 1.01
JSON_Parse_Nested_Containers 44618.29193219491 ns/iter 44590.40058591386 ns/iter 1.00
JSON_From_String_Copy 19.95224244540014 ns/iter 19.922958813384316 ns/iter 1.00
JSON_From_String_Temporary 17.14051603614308 ns/iter 17.444527484779904 ns/iter 0.98
JSON_Number_To_Double 23.96194488798388 ns/iter 22.607226735583676 ns/iter 1.06
JSON_Object_At_Last_Key/8 3.4615127682797686 ns/iter 3.4775426573891504 ns/iter 1.00
JSON_Object_At_Last_Key/32 11.83228551396869 ns/iter 11.859698205879305 ns/iter 1.00
JSON_Object_At_Last_Key/128 48.88765093793244 ns/iter 48.88107869587073 ns/iter 1.00
JSON_Object_At_Last_Key/512 384.2478058166655 ns/iter 385.79765284396547 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 56.6281303253903 ns/iter 56.64783547759209 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 165.4537471528695 ns/iter 171.7231231175144 ns/iter 0.96
JSON_Divisible_By_Decimal 252.5681647706203 ns/iter 248.74072969313585 ns/iter 1.02
JSON_String_Equal/10 6.853477122135098 ns/iter 6.85525335062266 ns/iter 1.00
JSON_String_Equal/100 7.4787743509594256 ns/iter 7.482588054869233 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9564126035787408 ns/iter 0.9366928228650075 ns/iter 1.02
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.929569523712201 ns/iter 10.618148052297173 ns/iter 1.41
JSON_String_Fast_Hash/10 2.1779819394969073 ns/iter 2.179394972486183 ns/iter 1.00
JSON_String_Fast_Hash/100 2.1777824020877614 ns/iter 2.179464344256187 ns/iter 1.00
JSON_String_Key_Hash/10 2.7289751792392067 ns/iter 2.1823363358665198 ns/iter 1.25
JSON_String_Key_Hash/100 9.021413008831539 ns/iter 6.537432439444578 ns/iter 1.38
JSON_Object_Defines_Miss_Same_Length 2.6638350927347547 ns/iter 2.7328266039998486 ns/iter 0.97
JSON_Object_Defines_Miss_Too_Small 2.581136314710909 ns/iter 2.780809466121227 ns/iter 0.93
JSON_Object_Defines_Miss_Too_Large 2.6135146227946837 ns/iter 2.7071499198596185 ns/iter 0.97
Pointer_Object_Traverse 24.05959833909629 ns/iter 24.04657773673117 ns/iter 1.00
Pointer_Object_Try_Traverse 28.416589020902816 ns/iter 28.445972460576233 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 210.29461848565947 ns/iter 160.09896449871437 ns/iter 1.31
Pointer_Walker_Schema_ISO_Language 1737603.3124998002 ns/iter 1718390.6268292605 ns/iter 1.01
Pointer_Maybe_Tracked_Deeply_Nested/0 1280007.3551237748 ns/iter 1291261.8784530691 ns/iter 0.99
Pointer_Maybe_Tracked_Deeply_Nested/1 1753136.1052631626 ns/iter 1805366.6887753098 ns/iter 0.97
Pointer_Position_Tracker_Get_Deeply_Nested 672.1984989436297 ns/iter 717.0095621206758 ns/iter 0.94
URITemplateRouter_Create 31917.2354571907 ns/iter 32209.648759190197 ns/iter 0.99
URITemplateRouter_Match 175.96106033420057 ns/iter 174.69550368771394 ns/iter 1.01
URITemplateRouter_Match_BasePath 199.70011348000412 ns/iter 205.4181091973541 ns/iter 0.97
URITemplateRouterView_Restore 7222.461122699388 ns/iter 7896.14216007371 ns/iter 0.91
URITemplateRouterView_Match 164.21700318606875 ns/iter 164.1997670137986 ns/iter 1.00
URITemplateRouterView_Match_BasePath 188.06610403672153 ns/iter 190.98507000951216 ns/iter 0.98
URITemplateRouterView_Arguments 441.3720236126183 ns/iter 432.41081440251253 ns/iter 1.02
JSONL_Parse_Large 9975722.728571717 ns/iter 9810496.88888902 ns/iter 1.02
JSONL_Parse_Large_GZIP 11531090.459017877 ns/iter 11350192.790323196 ns/iter 1.02
HTML_Build_Table_100000 68060520.09999348 ns/iter 69190170.39999744 ns/iter 0.98
HTML_Render_Table_100000 5198959.274074427 ns/iter 5530490.705426428 ns/iter 0.94
GZIP_Compress_ISO_Language_Set_3_Locations 33089058.047618803 ns/iter 33588218.238091506 ns/iter 0.99
GZIP_Decompress_ISO_Language_Set_3_Locations 4048428.606936511 ns/iter 4370286.416148775 ns/iter 0.93
GZIP_Compress_ISO_Language_Set_3_Schema 1884733.773584897 ns/iter 1892086.8405407297 ns/iter 1.00
GZIP_Decompress_ISO_Language_Set_3_Schema 351074.0513078672 ns/iter 352702.16826191323 ns/iter 1.00
JOSE_VerifySignature_RS256 57954.51969547027 ns/iter 58034.881090967545 ns/iter 1.00
JOSE_VerifySignature_ES512 2442386.5880282205 ns/iter 2419622.1487885737 ns/iter 1.01

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

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti merged commit 9bd9962 into main Jun 27, 2026
11 checks passed
@jviotti jviotti deleted the key-equals branch June 27, 2026 22:59

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Benchmark (windows/msvc)

Details
Benchmark suite Current: ddc8579 Previous: 3f61ec7 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 5.124401785713368 ns/iter 5.079984000003606 ns/iter 1.01
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 5.03705991183925 ns/iter 5.128569642855448 ns/iter 0.98
Regex_Period_Asterisk 5.043972999999369 ns/iter 5.060724999998456 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 5.034716000000117 ns/iter 5.047331250003546 ns/iter 1.00
Regex_Period_Plus 4.7940529124869755 ns/iter 4.933840291282835 ns/iter 0.97
Regex_Period 4.780594420710027 ns/iter 4.783467456425882 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 4.786990246603976 ns/iter 4.791234385697289 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 4.8077625107315844 ns/iter 4.786309353744624 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 5.051794000000882 ns/iter 5.019130000000587 ns/iter 1.01
Regex_Caret_Group_Period_Asterisk_Group_Dollar 5.052894000000379 ns/iter 5.067144000004191 ns/iter 1.00
Regex_Caret_X_Hyphen 8.26141852678676 ns/iter 8.183511160717266 ns/iter 1.01
Regex_Period_Md_Dollar 44.33676520601501 ns/iter 44.29703353306501 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 7.880584821428219 ns/iter 7.839699776788223 ns/iter 1.01
Regex_Caret_Period_Range_Dollar 5.97112053571485 ns/iter 5.957371000004059 ns/iter 1.00
Regex_Nested_Backtrack 54.31914285714307 ns/iter 54.056660000014745 ns/iter 1.00
JSON_Array_Of_Objects_Unique 496.0507514387733 ns/iter 506.8829000001642 ns/iter 0.98
JSON_Parse_1 8823.40525265419 ns/iter 8668.37946428437 ns/iter 1.02
JSON_Parse_Real 16140.62415596468 ns/iter 15969.122767864566 ns/iter 1.01
JSON_Parse_Decimal 11837.406250002403 ns/iter 11782.019642859203 ns/iter 1.00
JSON_Parse_Schema_ISO_Language 7301081.111111469 ns/iter 7141131.249998775 ns/iter 1.02
JSON_Parse_Integer 6154.341071428299 ns/iter 6114.71875000039 ns/iter 1.01
JSON_Parse_String_NonSSO_Plain 7634.297991072308 ns/iter 7683.856026784293 ns/iter 0.99
JSON_Parse_String_SSO_Plain 3528.2337111326865 ns/iter 3713.2160478267565 ns/iter 0.95
JSON_Parse_String_Escape_Heavy 21789.7624999992 ns/iter 21783.962500009577 ns/iter 1.00
JSON_Parse_Object_Short_Keys 13316.464285716327 ns/iter 13095.252922982803 ns/iter 1.02
JSON_Parse_Object_Scalar_Properties 6845.757142857322 ns/iter 6744.475446426789 ns/iter 1.02
JSON_Parse_Object_Array_Properties 11298.715625002842 ns/iter 11192.470312501257 ns/iter 1.01
JSON_Parse_Object_Object_Properties 11521.966071427414 ns/iter 11410.617187500804 ns/iter 1.01
JSON_Parse_Nested_Containers 79271.4732142993 ns/iter 78385.61383926342 ns/iter 1.01
JSON_From_String_Copy 64.08019642855882 ns/iter 64.13744642856045 ns/iter 1.00
JSON_From_String_Temporary 57.706312499996265 ns/iter 58.5216339285515 ns/iter 0.99
JSON_Number_To_Double 121.41958928570571 ns/iter 119.53178571429491 ns/iter 1.02
JSON_Object_At_Last_Key/8 7.502966517855774 ns/iter 7.231598214283557 ns/iter 1.04
JSON_Object_At_Last_Key/32 23.884020938790343 ns/iter 23.233861347849572 ns/iter 1.03
JSON_Object_At_Last_Key/128 95.19507164307834 ns/iter 89.2837834821287 ns/iter 1.07
JSON_Object_At_Last_Key/512 420.22712053567193 ns/iter 422.99634957522534 ns/iter 0.99
JSON_Fast_Hash_Helm_Chart_Lock 66.01790178570306 ns/iter 65.61319642855779 ns/iter 1.01
JSON_Equality_Helm_Chart_Lock 300.9907989965519 ns/iter 299.77619868569593 ns/iter 1.00
JSON_Divisible_By_Decimal 301.7130957909325 ns/iter 299.421475510989 ns/iter 1.01
JSON_String_Equal/10 15.126171361046046 ns/iter 15.147968750000018 ns/iter 1.00
JSON_String_Equal/100 16.466863839283974 ns/iter 16.493720982140303 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 2.522218214285691 ns/iter 2.509149285713517 ns/iter 1.01
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 15.054629397076717 ns/iter 14.276981186263702 ns/iter 1.05
JSON_String_Fast_Hash/10 4.704135948001315 ns/iter 4.747095535711716 ns/iter 0.99
JSON_String_Fast_Hash/100 4.7171692069566005 ns/iter 4.755928135617179 ns/iter 0.99
JSON_String_Key_Hash/10 5.341468999999961 ns/iter 5.342293750000441 ns/iter 1.00
JSON_String_Key_Hash/100 11.904426785715065 ns/iter 11.878678125000874 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 4.07889723032147 ns/iter 4.081036034072467 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 5.05583392857188 ns/iter 5.023768999999447 ns/iter 1.01
JSON_Object_Defines_Miss_Too_Large 4.482558124999514 ns/iter 4.388193124998452 ns/iter 1.02
Pointer_Object_Traverse 70.27417857143193 ns/iter 69.68349999998021 ns/iter 1.01
Pointer_Object_Try_Traverse 71.1808303571258 ns/iter 71.07258928572588 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 166.41011160710863 ns/iter 187.22883814549542 ns/iter 0.89
Pointer_Walker_Schema_ISO_Language 6972303.5714283865 ns/iter 6648415.178570336 ns/iter 1.05
Pointer_Maybe_Tracked_Deeply_Nested/0 2307810.367892519 ns/iter 2332290.635451293 ns/iter 0.99
Pointer_Maybe_Tracked_Deeply_Nested/1 3751589.3854749 ns/iter 3562793.8461519266 ns/iter 1.05
Pointer_Position_Tracker_Get_Deeply_Nested 584.6333015411288 ns/iter 511.40219250651376 ns/iter 1.14
URITemplateRouter_Create 47410.732780941325 ns/iter 40546.660089365025 ns/iter 1.17
URITemplateRouter_Match 245.09432344176048 ns/iter 233.3206874999405 ns/iter 1.05
URITemplateRouter_Match_BasePath 277.04160370348205 ns/iter 264.3299381396385 ns/iter 1.05
URITemplateRouterView_Restore 31299.911608724684 ns/iter 30298.00313392479 ns/iter 1.03
URITemplateRouterView_Match 184.5707575509594 ns/iter 179.40274816099446 ns/iter 1.03
URITemplateRouterView_Match_BasePath 212.73750389565154 ns/iter 205.08521473975782 ns/iter 1.04
URITemplateRouterView_Arguments 537.9230000000916 ns/iter 532.5341000002481 ns/iter 1.01
JSONL_Parse_Large 33044885.714291792 ns/iter 32635147.619029816 ns/iter 1.01
JSONL_Parse_Large_GZIP 33421809.52380485 ns/iter 33516299.99999551 ns/iter 1.00
HTML_Build_Table_100000 87832599.99998856 ns/iter 85549000.00003077 ns/iter 1.03
HTML_Render_Table_100000 7194304.4642860545 ns/iter 6853339.999997842 ns/iter 1.05
GZIP_Compress_ISO_Language_Set_3_Locations 36522215.78947415 ns/iter 36171947.368434064 ns/iter 1.01
GZIP_Decompress_ISO_Language_Set_3_Locations 9537750.666668216 ns/iter 9106097.33333331 ns/iter 1.05
GZIP_Compress_ISO_Language_Set_3_Schema 2123048.4374996196 ns/iter 2093880.6970508357 ns/iter 1.01
GZIP_Decompress_ISO_Language_Set_3_Schema 608725.6250000093 ns/iter 612211.1607144884 ns/iter 0.99
JOSE_VerifySignature_RS256 21288.43437500194 ns/iter 21165.168750002296 ns/iter 1.01
JOSE_VerifySignature_ES512 1541679.4642858023 ns/iter 1532926.3392861288 ns/iter 1.01

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant