Skip to content

Heavily optimise SchemaFrame::is_reachable across bases#2234

Merged
jviotti merged 2 commits intomainfrom
big-optimisations-reachability
Feb 4, 2026
Merged

Heavily optimise SchemaFrame::is_reachable across bases#2234
jviotti merged 2 commits intomainfrom
big-optimisations-reachability

Conversation

@jviotti
Copy link
Member

@jviotti jviotti commented Feb 4, 2026

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

Copy link

@github-actions github-actions bot left a comment

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: 38fe8f2 Previous: b8e0aa2 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 3.2431893800672276 ns/iter 4.971874000000298 ns/iter 0.65
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.9399594826695328 ns/iter 4.504204509933614 ns/iter 0.65
Regex_Period_Asterisk 2.8136249987440003 ns/iter 4.235759395430343 ns/iter 0.66
Regex_Group_Period_Asterisk_Group 3.076371098557126 ns/iter 4.191014127593231 ns/iter 0.73
Regex_Period_Plus 2.93035006303941 ns/iter 3.7809948146778978 ns/iter 0.78
Regex_Period 2.9630169156744444 ns/iter 3.7776827396325343 ns/iter 0.78
Regex_Caret_Period_Plus_Dollar 2.9483037906934957 ns/iter 3.810521243195869 ns/iter 0.77
Regex_Caret_Group_Period_Plus_Group_Dollar 2.9328153978576283 ns/iter 3.775043526785181 ns/iter 0.78
Regex_Caret_Period_Asterisk_Dollar 3.0441258928572013 ns/iter 4.092439471593268 ns/iter 0.74
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.9519035701106984 ns/iter 4.085527901785164 ns/iter 0.72
Regex_Caret_X_Hyphen 6.172798214285941 ns/iter 7.86915401785596 ns/iter 0.78
Regex_Period_Md_Dollar 30.997419642854343 ns/iter 35.303392843948146 ns/iter 0.88
Regex_Caret_Slash_Period_Asterisk 5.856101785714226 ns/iter 7.538505580357529 ns/iter 0.78
Regex_Caret_Period_Range_Dollar 3.576899927447152 ns/iter 4.728464073054338 ns/iter 0.76
Regex_Nested_Backtrack 87.02763392857297 ns/iter 94.58834845589686 ns/iter 0.92
JSON_Array_Of_Objects_Unique 415.22259307045647 ns/iter 508.377751683027 ns/iter 0.82
JSON_Parse_1 75396.48437501054 ns/iter 77695.60267857197 ns/iter 0.97
JSON_Parse_Real 93978.00991027942 ns/iter 100047.3906250221 ns/iter 0.94
JSON_Parse_Decimal 327072.0581341691 ns/iter 347261.8103910208 ns/iter 0.94
JSON_Parse_Schema_ISO_Language 63170936.36363841 ns/iter 58483427.27273865 ns/iter 1.08
JSON_Fast_Hash_Helm_Chart_Lock 53.11842999999499 ns/iter 69.34174999999853 ns/iter 0.77
JSON_Equality_Helm_Chart_Lock 253.76974999996295 ns/iter 291.12854201470657 ns/iter 0.87
JSON_String_Equal/10 11.025508928570714 ns/iter 13.120203571430368 ns/iter 0.84
JSON_String_Equal/100 14.244187436408852 ns/iter 15.004267857138741 ns/iter 0.95
JSON_String_Equal_Small_By_Perfect_Hash/10 1.5098979910713897 ns/iter 2.3155309374999433 ns/iter 0.65
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 9.34752317255686 ns/iter 13.089617857141482 ns/iter 0.71
JSON_String_Fast_Hash/10 2.9390803085642925 ns/iter 4.177608748135818 ns/iter 0.70
JSON_String_Fast_Hash/100 2.9302847505397587 ns/iter 4.488358258928825 ns/iter 0.65
JSON_String_Key_Hash/10 3.320694380189184 ns/iter 4.507837667502431 ns/iter 0.74
JSON_String_Key_Hash/100 14.013626723150775 ns/iter 14.026851499876262 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 4.217919375000179 ns/iter 3.8135057074758443 ns/iter 1.11
JSON_Object_Defines_Miss_Too_Small 4.086317864439364 ns/iter 3.7910496651795604 ns/iter 1.08
JSON_Object_Defines_Miss_Too_Large 4.0885783555160495 ns/iter 3.780463169642851 ns/iter 1.08
Pointer_Object_Traverse 46.15743530216667 ns/iter 58.020901785706 ns/iter 0.80
Pointer_Object_Try_Traverse 65.71962499998156 ns/iter 71.76486607144332 ns/iter 0.92
Pointer_Push_Back_Pointer_To_Weak_Pointer 173.15825489894658 ns/iter 154.28627232146093 ns/iter 1.12
Pointer_Walker_Schema_ISO_Language 12882187.499997143 ns/iter 10026597.333332272 ns/iter 1.28
Schema_Frame_WoT_References 10528257.81249922 ns/iter 9543350.666666204 ns/iter 1.10
Schema_Frame_OMC_References 43440812.49999476 ns/iter 41774543.74999456 ns/iter 1.04
Schema_Frame_OMC_Locations 38366033.33333086 ns/iter 38168963.157886535 ns/iter 1.01
Schema_Frame_ISO_Language_Locations 204754200.00002488 ns/iter 193834849.99997336 ns/iter 1.06
Schema_Frame_KrakenD_References 90492528.57143334 ns/iter 88324933.33332221 ns/iter 1.02
Schema_Frame_KrakenD_Reachable 913797199.9998627 ns/iter 21118126200.000008 ns/iter 0.04327075192873231
Schema_Iterator_ISO_Language 4800886.60714273 ns/iter 4401841.874999946 ns/iter 1.09
Schema_Frame_ISO_Language_Locations_To_JSON 323391799.9999676 ns/iter 265322900.00000104 ns/iter 1.22
Schema_Tracker_ISO_Language 112645966.66664298 ns/iter 101468966.66666786 ns/iter 1.11
Schema_Tracker_ISO_Language_To_JSON 63492345.45454733 ns/iter 54518379.999990426 ns/iter 1.16
Schema_Format_ISO_Language_To_JSON 221195399.99986652 ns/iter 201323675.00008285 ns/iter 1.10
Schema_Bundle_Meta_2020_12 3828568.7150692875 ns/iter 3932665.641012789 ns/iter 0.97
Schema_Frame_Many_Resources_References 1491710199.9999433 ns/iter 1425529999.9999807 ns/iter 1.05
Alterschema_Check_Readibility_ISO_Language_Set_3 327327849.99996054 ns/iter 317159650.0000078 ns/iter 1.03
Alterschema_Check_Readibility_OMC 65685990.90910125 ns/iter 56786099.999995224 ns/iter 1.16
Alterschema_Apply_Readibility_KrakenD 1073931799.9998548 ns/iter 851033799.9998683 ns/iter 1.26
EditorSchema_ForEditor_EmbeddedResources 25816405.882344097 ns/iter 26793432.142832376 ns/iter 0.96
URITemplateRouter_Create 20836.054204631844 ns/iter 22026.178124995964 ns/iter 0.95
URITemplateRouter_Match 239.4309107778706 ns/iter 209.78184374996542 ns/iter 1.14
URITemplateRouterView_Restore 27041.259059690776 ns/iter 31757.60267857137 ns/iter 0.85
URITemplateRouterView_Match 143.99477678571162 ns/iter 140.51651158409325 ns/iter 1.02

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

Copy link

@github-actions github-actions bot left a comment

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: 38fe8f2 Previous: b8e0aa2 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.903166845589254 ns/iter 3.1364995967473694 ns/iter 0.93
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.8921736481537446 ns/iter 3.107944315069398 ns/iter 0.93
Regex_Period_Asterisk 2.8945690907949055 ns/iter 3.107018376905427 ns/iter 0.93
Regex_Group_Period_Asterisk_Group 2.927545864042819 ns/iter 3.1092870764066647 ns/iter 0.94
Regex_Period_Plus 2.9633143986744743 ns/iter 2.982185725536161 ns/iter 0.99
Regex_Period 3.1084037139832774 ns/iter 3.1080055505956903 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 3.0283795805743488 ns/iter 3.1147038220839223 ns/iter 0.97
Regex_Caret_Group_Period_Plus_Group_Dollar 2.9613104823341763 ns/iter 2.966390753572389 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 3.4242827707918773 ns/iter 3.3748868161534418 ns/iter 1.01
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.1242547057068544 ns/iter 3.1902172343270214 ns/iter 0.98
Regex_Caret_X_Hyphen 10.272778095403275 ns/iter 13.057098712293428 ns/iter 0.79
Regex_Period_Md_Dollar 27.78024624299665 ns/iter 27.311686095029653 ns/iter 1.02
Regex_Caret_Slash_Period_Asterisk 6.239699740271226 ns/iter 6.2619651373387635 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 4.06585508414239 ns/iter 3.1081025643572673 ns/iter 1.31
Regex_Nested_Backtrack 50.098977899995134 ns/iter 52.37440090813757 ns/iter 0.96
JSON_Array_Of_Objects_Unique 441.81578194089064 ns/iter 440.0816643404168 ns/iter 1.00
JSON_Parse_1 29407.87316478046 ns/iter 29011.561352736262 ns/iter 1.01
JSON_Parse_Real 38620.60401057299 ns/iter 37841.353709906 ns/iter 1.02
JSON_Parse_Decimal 133464.6343637471 ns/iter 129405.28547702938 ns/iter 1.03
JSON_Parse_Schema_ISO_Language 22761006.25806521 ns/iter 22006453.21874717 ns/iter 1.03
JSON_Fast_Hash_Helm_Chart_Lock 62.638903072480026 ns/iter 62.41398912797394 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 166.98114212898756 ns/iter 163.0784491695347 ns/iter 1.02
JSON_String_Equal/10 6.769358626816618 ns/iter 6.852446104260334 ns/iter 0.99
JSON_String_Equal/100 7.195823487101643 ns/iter 7.473521373576105 ns/iter 0.96
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9395578795355815 ns/iter 0.9391525575623021 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 10.260061364033739 ns/iter 14.697495040335905 ns/iter 0.70
JSON_String_Fast_Hash/10 2.4876550765312055 ns/iter 2.490144216291622 ns/iter 1.00
JSON_String_Fast_Hash/100 2.493820982480397 ns/iter 2.5604754878053377 ns/iter 0.97
JSON_String_Key_Hash/10 2.5056211583172128 ns/iter 2.7156765373602694 ns/iter 0.92
JSON_String_Key_Hash/100 6.532052764283026 ns/iter 9.013178681805405 ns/iter 0.72
JSON_Object_Defines_Miss_Same_Length 3.7328788156990447 ns/iter 3.7521086748852617 ns/iter 0.99
JSON_Object_Defines_Miss_Too_Small 3.735789036579641 ns/iter 3.785738278152967 ns/iter 0.99
JSON_Object_Defines_Miss_Too_Large 3.7335829235622566 ns/iter 3.7393359394082095 ns/iter 1.00
Pointer_Object_Traverse 47.04441820281368 ns/iter 44.46417024498465 ns/iter 1.06
Pointer_Object_Try_Traverse 53.86765851153199 ns/iter 53.291044562974804 ns/iter 1.01
Pointer_Push_Back_Pointer_To_Weak_Pointer 348.7388513920863 ns/iter 304.2088894579437 ns/iter 1.15
Pointer_Walker_Schema_ISO_Language 3188591.0456622536 ns/iter 3128965.177777698 ns/iter 1.02
Schema_Frame_WoT_References 4837848.319444523 ns/iter 4827377.9517244445 ns/iter 1.00
Schema_Frame_OMC_References 20313454.114284467 ns/iter 20182138.470588867 ns/iter 1.01
Schema_Frame_OMC_Locations 18661820.43243412 ns/iter 18371215.64864987 ns/iter 1.02
Schema_Frame_ISO_Language_Locations 104009374.83332957 ns/iter 97582412.3333382 ns/iter 1.07
Schema_Frame_KrakenD_References 39210984.94444348 ns/iter 38308188.33333498 ns/iter 1.02
Schema_Frame_KrakenD_Reachable 836585477.9999609 ns/iter 15273143118.000008 ns/iter 0.05477493869706567
Schema_Iterator_ISO_Language 2339534.674576298 ns/iter 2322192.5927153532 ns/iter 1.01
Schema_Frame_ISO_Language_Locations_To_JSON 146899361.25000712 ns/iter 136164017.40000585 ns/iter 1.08
Schema_Tracker_ISO_Language 50597197.10000081 ns/iter 50026834.30000161 ns/iter 1.01
Schema_Tracker_ISO_Language_To_JSON 25794914.269231237 ns/iter 24522366.78571548 ns/iter 1.05
Schema_Format_ISO_Language_To_JSON 111418504.16665496 ns/iter 108895180.66668795 ns/iter 1.02
Schema_Bundle_Meta_2020_12 2054211.5526277032 ns/iter 2043318.480937453 ns/iter 1.01
Schema_Frame_Many_Resources_References 375849665.4999703 ns/iter 373277929.4999773 ns/iter 1.01
Alterschema_Check_Readibility_ISO_Language_Set_3 221430144.99999937 ns/iter 213454016.66667387 ns/iter 1.04
Alterschema_Check_Readibility_OMC 32114328.681819353 ns/iter 30610109.304348044 ns/iter 1.05
Alterschema_Apply_Readibility_KrakenD 614697372.0000232 ns/iter 505383481.00008076 ns/iter 1.22
EditorSchema_ForEditor_EmbeddedResources 13235691.094335055 ns/iter 13364110.634623872 ns/iter 0.99
URITemplateRouter_Create 17521.576409879646 ns/iter 17000.057967112214 ns/iter 1.03
URITemplateRouter_Match 174.90529178998707 ns/iter 174.23067041727612 ns/iter 1.00
URITemplateRouterView_Restore 8294.426645092277 ns/iter 8235.519251719657 ns/iter 1.01
URITemplateRouterView_Match 139.124411717837 ns/iter 126.19531568093835 ns/iter 1.10

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

Copy link

@github-actions github-actions bot left a comment

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: 38fe8f2 Previous: b8e0aa2 Ratio
URITemplateRouter_Create 14998.395519356622 ns/iter 14645.165346946416 ns/iter 1.02
URITemplateRouter_Match 174.58945139380688 ns/iter 160.95871652934116 ns/iter 1.08
URITemplateRouterView_Restore 8286.799549707363 ns/iter 8251.439722336976 ns/iter 1.00
URITemplateRouterView_Match 116.29630242097306 ns/iter 123.54765172568305 ns/iter 0.94
EditorSchema_ForEditor_EmbeddedResources 14037122.19998397 ns/iter 14061349.66000991 ns/iter 1.00
Alterschema_Check_Readibility_ISO_Language_Set_3 221130657.33333313 ns/iter 216266113.66665807 ns/iter 1.02
Alterschema_Check_Readibility_OMC 34698597.900001004 ns/iter 33969051.47619258 ns/iter 1.02
Alterschema_Apply_Readibility_KrakenD 623850414.0001168 ns/iter 544361888.9999015 ns/iter 1.15
Schema_Frame_WoT_References 5336093.595419593 ns/iter 5313069.696969154 ns/iter 1.00
Schema_Frame_OMC_References 22206773.483870372 ns/iter 22653488.4516094 ns/iter 0.98
Schema_Frame_OMC_Locations 20583077.411763098 ns/iter 21464087.235298235 ns/iter 0.96
Schema_Frame_ISO_Language_Locations 107484500.00001715 ns/iter 109566769.0000255 ns/iter 0.98
Schema_Frame_KrakenD_References 43021146.81250657 ns/iter 45888411.066668294 ns/iter 0.94
Schema_Frame_KrakenD_Reachable 851658423.9998792 ns/iter 15643183186.999977 ns/iter 0.05444278276480433
Schema_Iterator_ISO_Language 2775081.317460198 ns/iter 2663220.448669186 ns/iter 1.04
Schema_Frame_ISO_Language_Locations_To_JSON 307373938.00006884 ns/iter 237052735.00005814 ns/iter 1.30
Schema_Tracker_ISO_Language 51175531.64286294 ns/iter 51677628.23076863 ns/iter 0.99
Schema_Tracker_ISO_Language_To_JSON 34747270.74999464 ns/iter 40796140.33332746 ns/iter 0.85
Schema_Format_ISO_Language_To_JSON 116498103.99993992 ns/iter 125347802.66658647 ns/iter 0.93
Schema_Bundle_Meta_2020_12 2273614.9087864785 ns/iter 2252701.233972268 ns/iter 1.01
Schema_Frame_Many_Resources_References 390519530.50000066 ns/iter 399440013.4999978 ns/iter 0.98
Pointer_Object_Traverse 50.66323443572174 ns/iter 49.43167708028071 ns/iter 1.02
Pointer_Object_Try_Traverse 28.127091750474143 ns/iter 24.753247121487863 ns/iter 1.14
Pointer_Push_Back_Pointer_To_Weak_Pointer 159.86183423076443 ns/iter 133.90058768273914 ns/iter 1.19
Pointer_Walker_Schema_ISO_Language 3565117.5392663553 ns/iter 3576297.3404254634 ns/iter 1.00
JSON_Array_Of_Objects_Unique 425.5189839675936 ns/iter 393.30616700876817 ns/iter 1.08
JSON_Parse_1 33754.870716434554 ns/iter 33136.00264737049 ns/iter 1.02
JSON_Parse_Real 45304.334130111805 ns/iter 44070.4445561209 ns/iter 1.03
JSON_Parse_Decimal 156507.2456964135 ns/iter 155522.26654822927 ns/iter 1.01
JSON_Parse_Schema_ISO_Language 22712405.06451572 ns/iter 22524848.225804172 ns/iter 1.01
JSON_Fast_Hash_Helm_Chart_Lock 61.29941893714746 ns/iter 56.17150560001391 ns/iter 1.09
JSON_Equality_Helm_Chart_Lock 171.96492836104244 ns/iter 163.12916067093104 ns/iter 1.05
JSON_String_Equal/10 7.507710397148324 ns/iter 6.964544416962918 ns/iter 1.08
JSON_String_Equal/100 7.316593601079154 ns/iter 7.586955913154416 ns/iter 0.96
JSON_String_Equal_Small_By_Perfect_Hash/10 0.6234454453703451 ns/iter 0.9338725765642634 ns/iter 0.67
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.920756589186073 ns/iter 14.921260459902857 ns/iter 1.00
JSON_String_Fast_Hash/10 2.2563140786318674 ns/iter 1.9098186252073313 ns/iter 1.18
JSON_String_Fast_Hash/100 2.2544440706468416 ns/iter 1.9056012224582162 ns/iter 1.18
JSON_String_Key_Hash/10 1.245564847844488 ns/iter 1.5567178694875177 ns/iter 0.80
JSON_String_Key_Hash/100 12.428534742971799 ns/iter 12.432803840316309 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 2.487326065095873 ns/iter 2.797873181546944 ns/iter 0.89
JSON_Object_Defines_Miss_Too_Small 2.4916233321985293 ns/iter 2.7994729524780744 ns/iter 0.89
JSON_Object_Defines_Miss_Too_Large 2.4876404287890392 ns/iter 2.7985714203295253 ns/iter 0.89
Regex_Lower_S_Or_Upper_S_Asterisk 3.4240967992941456 ns/iter 3.1095848601134595 ns/iter 1.10
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 3.4904805969262416 ns/iter 3.1073556923361925 ns/iter 1.12
Regex_Period_Asterisk 3.4241179194836366 ns/iter 3.108617902710537 ns/iter 1.10
Regex_Group_Period_Asterisk_Group 3.4212520522387027 ns/iter 3.1275380390336758 ns/iter 1.09
Regex_Period_Plus 3.267029945275112 ns/iter 2.8004903481148076 ns/iter 1.17
Regex_Period 3.1098848884457277 ns/iter 2.7981885877514885 ns/iter 1.11
Regex_Caret_Period_Plus_Dollar 3.1103483446402227 ns/iter 2.7989040716171814 ns/iter 1.11
Regex_Caret_Group_Period_Plus_Group_Dollar 3.1105503292186127 ns/iter 2.7974044258836424 ns/iter 1.11
Regex_Caret_Period_Asterisk_Dollar 3.732279337897627 ns/iter 4.041278553100336 ns/iter 0.92
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.7329037803593583 ns/iter 4.040407079513693 ns/iter 0.92
Regex_Caret_X_Hyphen 13.071422671482804 ns/iter 13.718915464983073 ns/iter 0.95
Regex_Period_Md_Dollar 35.97893085654981 ns/iter 34.99145004969078 ns/iter 1.03
Regex_Caret_Slash_Period_Asterisk 9.954728073883228 ns/iter 8.710825423241722 ns/iter 1.14
Regex_Caret_Period_Range_Dollar 4.426204043092215 ns/iter 4.04366957379156 ns/iter 1.09
Regex_Nested_Backtrack 58.12381243099648 ns/iter 56.21708262821247 ns/iter 1.03

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

Copy link

@github-actions github-actions bot left a comment

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: 38fe8f2 Previous: b8e0aa2 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.740482325480349 ns/iter 4.390770223052773 ns/iter 0.62
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.503401407897695 ns/iter 5.5727766026685845 ns/iter 0.45
Regex_Period_Asterisk 2.163824122196712 ns/iter 8.920627499999227 ns/iter 0.24
Regex_Group_Period_Asterisk_Group 2.1037950437636597 ns/iter 5.221571212161253 ns/iter 0.40
Regex_Period_Plus 2.7214799059815653 ns/iter 6.321432166439126 ns/iter 0.43
Regex_Period 2.5061651905768656 ns/iter 8.427033511183858 ns/iter 0.30
Regex_Caret_Period_Plus_Dollar 2.7115003892936014 ns/iter 7.510239521481144 ns/iter 0.36
Regex_Caret_Group_Period_Plus_Group_Dollar 2.5612294208457858 ns/iter 6.698211594701842 ns/iter 0.38
Regex_Caret_Period_Asterisk_Dollar 2.3567951860456824 ns/iter 5.605133750000277 ns/iter 0.42
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.5789430459381197 ns/iter 8.571695409998483 ns/iter 0.30
Regex_Caret_X_Hyphen 9.328713870308214 ns/iter 19.668759912791305 ns/iter 0.47
Regex_Period_Md_Dollar 27.449432135273952 ns/iter 63.95667920000961 ns/iter 0.43
Regex_Caret_Slash_Period_Asterisk 11.601637846849641 ns/iter 13.68630185426734 ns/iter 0.85
Regex_Caret_Period_Range_Dollar 2.230420368865622 ns/iter 5.699149832457007 ns/iter 0.39
Regex_Nested_Backtrack 45.66352407910759 ns/iter 100.6671372213177 ns/iter 0.45
JSON_Array_Of_Objects_Unique 504.09897449597037 ns/iter 1015.9350268027777 ns/iter 0.50
JSON_Parse_1 24897.3003184557 ns/iter 75047.70278692903 ns/iter 0.33
JSON_Parse_Real 28863.102449071845 ns/iter 76689.3178156584 ns/iter 0.38
JSON_Parse_Decimal 268543.90988928144 ns/iter 888769.0027473046 ns/iter 0.30
JSON_Parse_Schema_ISO_Language 16832350.694446377 ns/iter 55113044.64286176 ns/iter 0.31
JSON_Fast_Hash_Helm_Chart_Lock 62.784970881027 ns/iter 163.5277937559962 ns/iter 0.38
JSON_Equality_Helm_Chart_Lock 156.73377097240797 ns/iter 463.9476401923317 ns/iter 0.34
JSON_String_Equal/10 6.928137228292478 ns/iter 22.21234920951983 ns/iter 0.31
JSON_String_Equal/100 6.577829168499666 ns/iter 22.47367409197835 ns/iter 0.29
JSON_String_Equal_Small_By_Perfect_Hash/10 0.3400440914095269 ns/iter 0.8328770757536342 ns/iter 0.41
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.3046156440083756 ns/iter 9.700072612399866 ns/iter 0.34
JSON_String_Fast_Hash/10 2.760432319824729 ns/iter 5.877384246979179 ns/iter 0.47
JSON_String_Fast_Hash/100 2.51310898160863 ns/iter 10.332962337393166 ns/iter 0.24
JSON_String_Key_Hash/10 1.7374458170675953 ns/iter 5.329147728267782 ns/iter 0.33
JSON_String_Key_Hash/100 2.42901742821786 ns/iter 8.55422829469315 ns/iter 0.28
JSON_Object_Defines_Miss_Same_Length 2.9658521147221704 ns/iter 9.89361232105682 ns/iter 0.30
JSON_Object_Defines_Miss_Too_Small 3.1198522380862483 ns/iter 8.027588621873276 ns/iter 0.39
JSON_Object_Defines_Miss_Too_Large 3.412017863338973 ns/iter 9.749940715956622 ns/iter 0.35
Pointer_Object_Traverse 15.741189145158108 ns/iter 92.66343329998108 ns/iter 0.17
Pointer_Object_Try_Traverse 22.69852047369091 ns/iter 86.03897706525541 ns/iter 0.26
Pointer_Push_Back_Pointer_To_Weak_Pointer 155.40327044913474 ns/iter 789.4173329998466 ns/iter 0.20
Pointer_Walker_Schema_ISO_Language 4018740.3846143293 ns/iter 20877855.086956 ns/iter 0.19
Schema_Frame_WoT_References 4442695.604791629 ns/iter 25936585.365853693 ns/iter 0.17
Schema_Frame_OMC_References 24438066.68000434 ns/iter 124670677.12501034 ns/iter 0.20
Schema_Frame_OMC_Locations 22442270.812497612 ns/iter 103259236.16668813 ns/iter 0.22
Schema_Frame_ISO_Language_Locations 78103267.85715915 ns/iter 326182729.0000383 ns/iter 0.24
Schema_Frame_KrakenD_References 48550071.42857306 ns/iter 177033341.6000085 ns/iter 0.27
Schema_Frame_KrakenD_Reachable 431176062.49995786 ns/iter 48126074374.999916 ns/iter 0.008959302583880417
Schema_Iterator_ISO_Language 2095270.8323866369 ns/iter 5088125.830000081 ns/iter 0.41
Schema_Frame_ISO_Language_Locations_To_JSON 127802308.40003243 ns/iter 183274927.25001094 ns/iter 0.70
Schema_Tracker_ISO_Language 64416999.999998055 ns/iter 89377338.00000085 ns/iter 0.72
Schema_Tracker_ISO_Language_To_JSON 21151963.70967961 ns/iter 26034640.40741225 ns/iter 0.81
Schema_Format_ISO_Language_To_JSON 99065976.28576362 ns/iter 287169624.99985737 ns/iter 0.34
Schema_Bundle_Meta_2020_12 1896458.9242071328 ns/iter 4718193.639107077 ns/iter 0.40
Schema_Frame_Many_Resources_References 605542167.0000669 ns/iter 1147374334.0000055 ns/iter 0.53
Alterschema_Check_Readibility_ISO_Language_Set_3 260422194.33338687 ns/iter 737137500.000017 ns/iter 0.35
Alterschema_Check_Readibility_OMC 56666541.69999675 ns/iter 132657166.60002908 ns/iter 0.43
Alterschema_Apply_Readibility_KrakenD 597215999.999662 ns/iter 1576635833.9999442 ns/iter 0.38
EditorSchema_ForEditor_EmbeddedResources 12639862.466664908 ns/iter 24415515.366634585 ns/iter 0.52
URITemplateRouter_Create 17960.74294610594 ns/iter 43828.52936349593 ns/iter 0.41
URITemplateRouter_Match 175.29840034348217 ns/iter 572.2430733256759 ns/iter 0.31
URITemplateRouterView_Restore 9796.481866839405 ns/iter 53055.56929061786 ns/iter 0.18
URITemplateRouterView_Match 111.45123610592054 ns/iter 434.7381538726756 ns/iter 0.26

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

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti force-pushed the big-optimisations-reachability branch from 9a21158 to a3fc145 Compare February 4, 2026 20:24
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti marked this pull request as ready for review February 4, 2026 20:46
Copy link

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

Choose a reason for hiding this comment

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

No issues found across 2 files

@jviotti jviotti merged commit 8067ad9 into main Feb 4, 2026
12 checks passed
@jviotti jviotti deleted the big-optimisations-reachability branch February 4, 2026 20:50
@augmentcode
Copy link

augmentcode bot commented Feb 4, 2026

🤖 Augment PR Summary

Summary: This PR refactors and optimizes SchemaFrame::is_reachable by replacing the previous “monster” fixpoint-based implementation with precomputed caches and a BFS-style reachability traversal.

Changes:

  • Introduces new cached structures for reachability computation (reference graph, location-member boundaries, reachability graph, per-base reachability results).
  • Builds a reusable reachability_graph_ with both parent→child edges and reference edges derived from $ref/$dynamicRef resolution.
  • Computes reachability via queue traversal from a chosen base location, marking pointers reachable as nodes are visited.
  • Updates reset() to clear the new caches.
  • Relaxes is_reachable to return false when an entry isn’t present in the cache (instead of asserting).

Technical Notes: The new approach aims to reduce repeated work across bases by caching intermediate graphs and maps, while preserving orphan/location-member boundary semantics.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

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

}
auto SchemaFrame::populate_location_members(
const SchemaWalker &walker, const SchemaResolver &resolver) const -> void {
if (!this->location_members_children_.empty()) {
Copy link

Choose a reason for hiding this comment

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

populate_location_members() uses location_members_children_.empty() as the “already populated” sentinel, which means schemas with zero LocationMembers will recompute this work on every call. That seems likely to undermine the intended caching/optimization (consider tracking an explicit populated flag).

Severity: medium

Fix This in Augment

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

// (3) Build a reverse mapping from reference destinations to their sources
// ---------------------------------------------------------------------------
auto SchemaFrame::populate_reference_graph() const -> void {
if (!this->references_by_destination_.empty()) {
Copy link

Choose a reason for hiding this comment

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

populate_reference_graph() returns early only when references_by_destination_ is non-empty, so schemas with no resolvable references will rebuild the graph on every call. If this is intended as a cache, it likely needs an explicit “populated” indicator to avoid repeated recomputation.

Severity: medium

Fix This in Augment

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

const SchemaWalker &walker,
const SchemaResolver &resolver) const
-> const ReachabilityCache & {
const ReachabilityKey key{.pointer = &base.pointer, .orphan = base.orphan};
Copy link

Choose a reason for hiding this comment

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

The reachability cache key only includes base (pointer address + orphan), but the computed reachability also depends on walker/resolver (via vocabularies/LocationMembers). If callers ever use different SchemaResolver/SchemaWalker instances, this cache can return stale/incorrect results unless that’s an invariant that’s enforced/documented.

Severity: medium

Other Locations
  • src/core/jsonschema/frame.cc:1608
  • src/core/jsonschema/frame.cc:1613

Fix This in Augment

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

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