Skip to content

Optimise wrapping to subschemas with no references#2221

Merged
jviotti merged 4 commits intomainfrom
faster-wrap
Feb 2, 2026
Merged

Optimise wrapping to subschemas with no references#2221
jviotti merged 4 commits intomainfrom
faster-wrap

Conversation

@jviotti
Copy link
Member

@jviotti jviotti commented Jan 30, 2026

See: sourcemeta/jsonschema#629
Signed-off-by: Juan Cruz Viotti jv@jviotti.com

@jviotti jviotti force-pushed the faster-wrap branch 3 times, most recently from 42187e2 to f36b272 Compare January 30, 2026 21:06
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: 139f978 Previous: 4e9d280 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 3.1722559269697634 ns/iter 3.1087352289626504 ns/iter 1.02
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 3.1101322591572322 ns/iter 3.1275676283073106 ns/iter 0.99
Regex_Period_Asterisk 3.1082105827722 ns/iter 3.1082574699199452 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 3.1102754139263107 ns/iter 3.111303710587261 ns/iter 1.00
Regex_Period_Plus 3.1096369532034 ns/iter 3.1113851338123917 ns/iter 1.00
Regex_Period 2.915705202949753 ns/iter 2.878335326532401 ns/iter 1.01
Regex_Caret_Period_Plus_Dollar 3.1092201730718525 ns/iter 3.1089525329817684 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 3.1077137112966664 ns/iter 3.1102818931233234 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 3.731197051868235 ns/iter 3.738008921156584 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.4197175181356427 ns/iter 3.4198732425917724 ns/iter 1.00
Regex_Caret_X_Hyphen 10.260287909574261 ns/iter 10.264180625019614 ns/iter 1.00
Regex_Period_Md_Dollar 27.645983613520123 ns/iter 27.229379831889464 ns/iter 1.02
Regex_Caret_Slash_Period_Asterisk 7.464147785957316 ns/iter 7.4630903871275756 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 4.043113179119222 ns/iter 3.747828495959293 ns/iter 1.08
Regex_Nested_Backtrack 57.68133957605068 ns/iter 48.9217292113372 ns/iter 1.18
JSON_Array_Of_Objects_Unique 457.85107356193845 ns/iter 464.2963789874119 ns/iter 0.99
JSON_Parse_1 29190.614286311607 ns/iter 29162.988718035966 ns/iter 1.00
JSON_Parse_Real 38343.25854513222 ns/iter 38054.14959251972 ns/iter 1.01
JSON_Parse_Decimal 130554.32426388825 ns/iter 132065.71374550374 ns/iter 0.99
JSON_Parse_Schema_ISO_Language 22237376.935483936 ns/iter 21971221.718750656 ns/iter 1.01
JSON_Fast_Hash_Helm_Chart_Lock 55.66364793569507 ns/iter 55.62431744512534 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 153.57747430597058 ns/iter 164.75487305043737 ns/iter 0.93
JSON_String_Equal/10 6.85218294025813 ns/iter 8.09367312738554 ns/iter 0.85
JSON_String_Equal/100 7.4657956537648955 ns/iter 8.718259676530934 ns/iter 0.86
JSON_String_Equal_Small_By_Perfect_Hash/10 0.937132799286407 ns/iter 0.9387175765495896 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 10.258078635321228 ns/iter 10.264598108670883 ns/iter 1.00
JSON_String_Fast_Hash/10 2.181788360651364 ns/iter 2.179924511418045 ns/iter 1.00
JSON_String_Fast_Hash/100 2.1763016601235408 ns/iter 2.177891560147855 ns/iter 1.00
JSON_String_Key_Hash/10 2.4907043762220917 ns/iter 2.4912595966783972 ns/iter 1.00
JSON_String_Key_Hash/100 6.527762404762974 ns/iter 6.532692522125289 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.7335940043165374 ns/iter 3.7402766354636183 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.737155099237671 ns/iter 3.734657388425708 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.7355303436909275 ns/iter 3.73730310189639 ns/iter 1.00
Pointer_Object_Traverse 44.52502832223563 ns/iter 44.864414937746076 ns/iter 0.99
Pointer_Object_Try_Traverse 52.623960482523806 ns/iter 52.63335028296608 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 355.6207522364545 ns/iter 353.0411539618257 ns/iter 1.01
Pointer_Walker_Schema_ISO_Language 3245791.7110090996 ns/iter 3134628.4687501225 ns/iter 1.04
Schema_Frame_WoT_References 6017388.547008569 ns/iter 5979451.31356016 ns/iter 1.01
Schema_Frame_OMC_References 28293073.70833097 ns/iter 28328490.640001293 ns/iter 1.00
Schema_Frame_OMC_Locations 26987663.769231264 ns/iter 26798584.23076754 ns/iter 1.01
Schema_Frame_ISO_Language_Locations 129893138.79998007 ns/iter 125097286.00000472 ns/iter 1.04
Schema_Frame_KrakenD_References 54324157.61538323 ns/iter 51534907.69231002 ns/iter 1.05
Schema_Frame_KrakenD_Reachable 509721.25287357974 ns/iter 506359.0943925371 ns/iter 1.01
Schema_Iterator_ISO_Language 2346148.618243347 ns/iter 2384350.2331081443 ns/iter 0.98
Schema_Frame_ISO_Language_Locations_To_JSON 133515571.49999848 ns/iter 128059621.60000491 ns/iter 1.04
Schema_Tracker_ISO_Language 46211291.19999902 ns/iter 44682083.333335266 ns/iter 1.03
Schema_Tracker_ISO_Language_To_JSON 23292335.433332786 ns/iter 21465091.000003155 ns/iter 1.09
Schema_Format_ISO_Language_To_JSON 136929379.0000029 ns/iter 129778489.99996695 ns/iter 1.06
Schema_Bundle_Meta_2020_12 2209717.6107593705 ns/iter 2179763.196876294 ns/iter 1.01
Schema_Frame_Many_Resources_References 270501092.3333475 ns/iter 262619804.6666559 ns/iter 1.03
Alterschema_Check_Readibility_ISO_Language_Set_3 244972615.6666732 ns/iter 236996955.66665468 ns/iter 1.03
Alterschema_Check_Readibility_OMC 38754125.94444091 ns/iter 39099279.22222778 ns/iter 0.99
Alterschema_Apply_Readibility_KrakenD 557880694.9999944 ns/iter 547115942.9999943 ns/iter 1.02
EditorSchema_ForEditor_EmbeddedResources 14890398.562504478 ns/iter 14685269.541665493 ns/iter 1.01
URITemplateRouter_Create 16634.28866243922 ns/iter 16843.621414730405 ns/iter 0.99
URITemplateRouter_Match 176.4311930065529 ns/iter 174.1312330328762 ns/iter 1.01
URITemplateRouterView_Restore 8143.996310085666 ns/iter 7697.687577428224 ns/iter 1.06
URITemplateRouterView_Match 122.02247414434099 ns/iter 138.267271900839 ns/iter 0.88

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

See: sourcemeta/jsonschema#629
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: 139f978 Previous: 4e9d280 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 4.48982500000028 ns/iter 4.466919185460765 ns/iter 1.01
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 4.1113637573408095 ns/iter 4.209210625000281 ns/iter 0.98
Regex_Period_Asterisk 3.826366600310987 ns/iter 3.7886930803570404 ns/iter 1.01
Regex_Group_Period_Asterisk_Group 3.7939357306799066 ns/iter 3.9301443373749763 ns/iter 0.97
Regex_Period_Plus 3.795524993223298 ns/iter 3.783226600387558 ns/iter 1.00
Regex_Period 3.7885826718055884 ns/iter 3.789087850376118 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 3.8462753502739546 ns/iter 3.83148802887252 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 3.793920528939323 ns/iter 3.7841126718146243 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 3.784243386944249 ns/iter 3.806030886060552 ns/iter 0.99
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.781604457532778 ns/iter 3.9756757812498784 ns/iter 0.95
Regex_Caret_X_Hyphen 7.544830357143642 ns/iter 7.603188616072439 ns/iter 0.99
Regex_Period_Md_Dollar 34.95345914093823 ns/iter 35.114767175573625 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 7.229715178569661 ns/iter 7.297029017855497 ns/iter 0.99
Regex_Caret_Period_Range_Dollar 4.7278881801958414 ns/iter 4.736333715929277 ns/iter 1.00
Regex_Nested_Backtrack 94.44104042674553 ns/iter 97.34415636855252 ns/iter 0.97
JSON_Array_Of_Objects_Unique 455.40811015842917 ns/iter 464.43626438320615 ns/iter 0.98
JSON_Parse_1 73686.85267858308 ns/iter 73027.53348213795 ns/iter 1.01
JSON_Parse_Real 94707.60680328002 ns/iter 93892.14062501595 ns/iter 1.01
JSON_Parse_Decimal 333691.427104747 ns/iter 330968.6149312261 ns/iter 1.01
JSON_Parse_Schema_ISO_Language 60733236.363623954 ns/iter 56294327.27271871 ns/iter 1.08
JSON_Fast_Hash_Helm_Chart_Lock 59.19442857142648 ns/iter 58.02816000000348 ns/iter 1.02
JSON_Equality_Helm_Chart_Lock 293.7821358831576 ns/iter 264.3192857142854 ns/iter 1.11
JSON_String_Equal/10 12.614444642857896 ns/iter 12.631933928572282 ns/iter 1.00
JSON_String_Equal/100 14.213979177613982 ns/iter 14.216239222249037 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 2.2027471874999094 ns/iter 2.1977268749999723 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 12.851866071429184 ns/iter 12.843058928569103 ns/iter 1.00
JSON_String_Fast_Hash/10 3.4601094134634494 ns/iter 3.4503852170525646 ns/iter 1.00
JSON_String_Fast_Hash/100 3.4759189670068165 ns/iter 3.542774190893283 ns/iter 0.98
JSON_String_Key_Hash/10 4.415034999999534 ns/iter 4.401666874998966 ns/iter 1.00
JSON_String_Key_Hash/100 13.773039447445186 ns/iter 13.837369642857311 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.7745292789742457 ns/iter 3.775098743258785 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.781019457533838 ns/iter 3.790428743232414 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.7911889218013575 ns/iter 3.771951421836167 ns/iter 1.01
Pointer_Object_Traverse 48.574795727115074 ns/iter 49.75464676503563 ns/iter 0.98
Pointer_Object_Try_Traverse 66.68602678571642 ns/iter 70.64833035715066 ns/iter 0.94
Pointer_Push_Back_Pointer_To_Weak_Pointer 148.52876122641894 ns/iter 162.96767857143988 ns/iter 0.91
Pointer_Walker_Schema_ISO_Language 11534551.785713023 ns/iter 11279064.285714315 ns/iter 1.02
Schema_Frame_WoT_References 11966573.214286719 ns/iter 11615501.785712468 ns/iter 1.03
Schema_Frame_OMC_References 59869990.909088634 ns/iter 59665445.454542845 ns/iter 1.00
Schema_Frame_OMC_Locations 56360410.00000205 ns/iter 55816570.00000177 ns/iter 1.01
Schema_Frame_ISO_Language_Locations 257719599.99997306 ns/iter 250902766.66666493 ns/iter 1.03
Schema_Frame_KrakenD_References 118676599.99999584 ns/iter 118574166.66665207 ns/iter 1.00
Schema_Frame_KrakenD_Reachable 1454079.9107142074 ns/iter 1434576.8736620618 ns/iter 1.01
Schema_Iterator_ISO_Language 4586465.10067154 ns/iter 4187125.903614693 ns/iter 1.10
Schema_Frame_ISO_Language_Locations_To_JSON 268407466.6666826 ns/iter 255837266.6666552 ns/iter 1.05
Schema_Tracker_ISO_Language 110511399.9999882 ns/iter 98643071.42856887 ns/iter 1.12
Schema_Tracker_ISO_Language_To_JSON 58797672.727264814 ns/iter 53612879.99999149 ns/iter 1.10
Schema_Format_ISO_Language_To_JSON 274676733.3333082 ns/iter 255956966.666569 ns/iter 1.07
Schema_Bundle_Meta_2020_12 4670960.71429296 ns/iter 4266580.722899737 ns/iter 1.09
Schema_Frame_Many_Resources_References 555203399.9999821 ns/iter 531776399.9998988 ns/iter 1.04
Alterschema_Check_Readibility_ISO_Language_Set_3 388336399.9999574 ns/iter 371410850.0000748 ns/iter 1.05
Alterschema_Check_Readibility_OMC 86688933.33333471 ns/iter 81486744.44444421 ns/iter 1.06
Alterschema_Apply_Readibility_KrakenD 1219856899.999968 ns/iter 1153279999.9999952 ns/iter 1.06
EditorSchema_ForEditor_EmbeddedResources 27656431.81818301 ns/iter 25807392.857164554 ns/iter 1.07
URITemplateRouter_Create 22075.346874999013 ns/iter 22041.259374994126 ns/iter 1.00
URITemplateRouter_Match 210.51842140539014 ns/iter 211.02707540058478 ns/iter 1.00
URITemplateRouterView_Restore 32917.884502060755 ns/iter 30922.96875000297 ns/iter 1.06
URITemplateRouterView_Match 142.55870792148247 ns/iter 151.06852678568674 ns/iter 0.94

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: 139f978 Previous: 4e9d280 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.6496138036143277 ns/iter 2.4162642670878998 ns/iter 0.68
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.6406131212683854 ns/iter 2.274145801888211 ns/iter 0.72
Regex_Period_Asterisk 1.6424793271852267 ns/iter 2.573125901971104 ns/iter 0.64
Regex_Group_Period_Asterisk_Group 1.6478128458818448 ns/iter 2.448704558376901 ns/iter 0.67
Regex_Period_Plus 1.9775517000133949 ns/iter 2.9240294256130293 ns/iter 0.68
Regex_Period 1.9854740314586126 ns/iter 2.825442953126019 ns/iter 0.70
Regex_Caret_Period_Plus_Dollar 1.9828824807813754 ns/iter 2.7298212947192075 ns/iter 0.73
Regex_Caret_Group_Period_Plus_Group_Dollar 2.036164881104925 ns/iter 2.7454791701211074 ns/iter 0.74
Regex_Caret_Period_Asterisk_Dollar 1.6870911795125836 ns/iter 2.7438947301286722 ns/iter 0.61
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.8148282311217292 ns/iter 2.144129797605712 ns/iter 0.85
Regex_Caret_X_Hyphen 6.819177498142701 ns/iter 7.820911088622476 ns/iter 0.87
Regex_Period_Md_Dollar 21.4726189547277 ns/iter 26.59226775865208 ns/iter 0.81
Regex_Caret_Slash_Period_Asterisk 5.4234766031359865 ns/iter 7.125814907160466 ns/iter 0.76
Regex_Caret_Period_Range_Dollar 1.9681408386715658 ns/iter 2.4618646082875633 ns/iter 0.80
Regex_Nested_Backtrack 30.560036052555738 ns/iter 48.30142676004794 ns/iter 0.63
JSON_Array_Of_Objects_Unique 388.86000082054676 ns/iter 478.163896320664 ns/iter 0.81
JSON_Parse_1 23601.244710246032 ns/iter 31291.392486777695 ns/iter 0.75
JSON_Parse_Real 28047.356746766145 ns/iter 33983.625952678405 ns/iter 0.83
JSON_Parse_Decimal 242622.73015867523 ns/iter 418712.37730215985 ns/iter 0.58
JSON_Parse_Schema_ISO_Language 15740526.844441168 ns/iter 22241217.250000644 ns/iter 0.71
JSON_Fast_Hash_Helm_Chart_Lock 56.32182012986283 ns/iter 79.72508874930084 ns/iter 0.71
JSON_Equality_Helm_Chart_Lock 129.40185329886452 ns/iter 185.98909787967037 ns/iter 0.70
JSON_String_Equal/10 6.56472184528052 ns/iter 9.30003713621976 ns/iter 0.71
JSON_String_Equal/100 6.288988112666806 ns/iter 9.125208238738333 ns/iter 0.69
JSON_String_Equal_Small_By_Perfect_Hash/10 0.3348196910644842 ns/iter 0.40659538356364744 ns/iter 0.82
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.178017964321047 ns/iter 4.234989609238085 ns/iter 0.75
JSON_String_Fast_Hash/10 2.302603526562161 ns/iter 2.7979228068833044 ns/iter 0.82
JSON_String_Fast_Hash/100 1.9980099953142483 ns/iter 2.6093885389869986 ns/iter 0.77
JSON_String_Key_Hash/10 1.356791934448335 ns/iter 1.9054538759422974 ns/iter 0.71
JSON_String_Key_Hash/100 2.2254911513331215 ns/iter 3.8507450664350644 ns/iter 0.58
JSON_Object_Defines_Miss_Same_Length 2.978077459124755 ns/iter 3.7457767877614754 ns/iter 0.80
JSON_Object_Defines_Miss_Too_Small 2.9505194938362247 ns/iter 3.323574971349522 ns/iter 0.89
JSON_Object_Defines_Miss_Too_Large 2.978420013234881 ns/iter 3.932986517120083 ns/iter 0.76
Pointer_Object_Traverse 15.754500766453146 ns/iter 26.76660245701877 ns/iter 0.59
Pointer_Object_Try_Traverse 22.101629824902272 ns/iter 32.47127155866347 ns/iter 0.68
Pointer_Push_Back_Pointer_To_Weak_Pointer 164.6025693159148 ns/iter 226.69880478454212 ns/iter 0.73
Pointer_Walker_Schema_ISO_Language 4547363.043478902 ns/iter 6414693.342105294 ns/iter 0.71
Schema_Frame_WoT_References 5603306.6406246945 ns/iter 7998763.235293475 ns/iter 0.70
Schema_Frame_OMC_References 31175359.818172928 ns/iter 42511588.56249759 ns/iter 0.73
Schema_Frame_OMC_Locations 28314853.35999787 ns/iter 46028107.82352448 ns/iter 0.62
Schema_Frame_ISO_Language_Locations 98518729.16666101 ns/iter 155837558.20000535 ns/iter 0.63
Schema_Frame_KrakenD_References 57788715.249993555 ns/iter 83100115.66666415 ns/iter 0.70
Schema_Frame_KrakenD_Reachable 291753.05391741527 ns/iter 584782.5959279486 ns/iter 0.50
Schema_Iterator_ISO_Language 1958291.5521978366 ns/iter 3226284.482758305 ns/iter 0.61
Schema_Frame_ISO_Language_Locations_To_JSON 90105470.28570466 ns/iter 132717603.99999267 ns/iter 0.68
Schema_Tracker_ISO_Language 40050166.647059835 ns/iter 56999937.49999521 ns/iter 0.70
Schema_Tracker_ISO_Language_To_JSON 14251415.791666962 ns/iter 22246432.142856065 ns/iter 0.64
Schema_Format_ISO_Language_To_JSON 103908351.28568402 ns/iter 152063062.74995995 ns/iter 0.68
Schema_Bundle_Meta_2020_12 1745957.5467280266 ns/iter 2471472.258994352 ns/iter 0.71
Schema_Frame_Many_Resources_References 344772812.5000822 ns/iter 297221916.500007 ns/iter 1.16
Alterschema_Check_Readibility_ISO_Language_Set_3 219850389.00000593 ns/iter 240996985.9999895 ns/iter 0.91
Alterschema_Check_Readibility_OMC 46199186.13334449 ns/iter 60398931.818181984 ns/iter 0.76
Alterschema_Apply_Readibility_KrakenD 561629958.0001396 ns/iter 783082833.9999698 ns/iter 0.72
EditorSchema_ForEditor_EmbeddedResources 15660110.892846595 ns/iter 17658105.210512675 ns/iter 0.89
URITemplateRouter_Create 20102.10382361025 ns/iter 22400.803159357143 ns/iter 0.90
URITemplateRouter_Match 233.2368182690326 ns/iter 207.31150553662346 ns/iter 1.13
URITemplateRouterView_Restore 10220.205341292383 ns/iter 15496.898929455281 ns/iter 0.66
URITemplateRouterView_Match 128.3174256084736 ns/iter 154.5007185824836 ns/iter 0.83

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: 139f978 Previous: 4e9d280 Ratio
URITemplateRouter_Create 14900.47966907666 ns/iter 14961.88170293304 ns/iter 1.00
URITemplateRouter_Match 160.19483846842866 ns/iter 176.64900880136756 ns/iter 0.91
URITemplateRouterView_Restore 8116.334031739976 ns/iter 8331.405032652174 ns/iter 0.97
URITemplateRouterView_Match 116.72214586384816 ns/iter 116.0082944529165 ns/iter 1.01
EditorSchema_ForEditor_EmbeddedResources 15812840.704525528 ns/iter 15536921.000011716 ns/iter 1.02
Alterschema_Check_Readibility_ISO_Language_Set_3 242209590.99996737 ns/iter 243051465.99999717 ns/iter 1.00
Alterschema_Check_Readibility_OMC 41244126.11764348 ns/iter 42194596.47059493 ns/iter 0.98
Alterschema_Apply_Readibility_KrakenD 589792599.9997824 ns/iter 612690873.9997816 ns/iter 0.96
Schema_Frame_WoT_References 6571216.728971364 ns/iter 6529619.240742099 ns/iter 1.01
Schema_Frame_OMC_References 30421881.391297888 ns/iter 30972643.304346055 ns/iter 0.98
Schema_Frame_OMC_Locations 28457779.919999667 ns/iter 28737239.458337173 ns/iter 0.99
Schema_Frame_ISO_Language_Locations 132431005.4000307 ns/iter 132295859.79997864 ns/iter 1.00
Schema_Frame_KrakenD_References 54857831.46153923 ns/iter 57449926.000003874 ns/iter 0.95
Schema_Frame_KrakenD_Reachable 502747.4433960241 ns/iter 511158.83659487433 ns/iter 0.98
Schema_Iterator_ISO_Language 2588401.892592595 ns/iter 2627229.867924675 ns/iter 0.99
Schema_Frame_ISO_Language_Locations_To_JSON 310871960.49998057 ns/iter 303177983.5000634 ns/iter 1.03
Schema_Tracker_ISO_Language 47202474.599998824 ns/iter 50252747.57143247 ns/iter 0.94
Schema_Tracker_ISO_Language_To_JSON 33259280.285717197 ns/iter 34551064.449999556 ns/iter 0.96
Schema_Format_ISO_Language_To_JSON 139032213.40001437 ns/iter 139888383.00010684 ns/iter 0.99
Schema_Bundle_Meta_2020_12 2428481.496526697 ns/iter 2412158.731038383 ns/iter 1.01
Schema_Frame_Many_Resources_References 289769521.0000393 ns/iter 285210359.4999562 ns/iter 1.02
Pointer_Object_Traverse 46.32527347850483 ns/iter 49.33553728828083 ns/iter 0.94
Pointer_Object_Try_Traverse 29.046100979347038 ns/iter 24.87197704794119 ns/iter 1.17
Pointer_Push_Back_Pointer_To_Weak_Pointer 167.17344924570492 ns/iter 162.3206503601655 ns/iter 1.03
Pointer_Walker_Schema_ISO_Language 3489864.562188859 ns/iter 3470190.3517582393 ns/iter 1.01
JSON_Array_Of_Objects_Unique 421.03631818431853 ns/iter 401.08709370346344 ns/iter 1.05
JSON_Parse_1 33150.31019090391 ns/iter 33413.84130994277 ns/iter 0.99
JSON_Parse_Real 44812.75409835207 ns/iter 44272.48123537304 ns/iter 1.01
JSON_Parse_Decimal 156069.11039105407 ns/iter 157134.05846773266 ns/iter 0.99
JSON_Parse_Schema_ISO_Language 22348805.45161251 ns/iter 22432033.35483339 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 61.53513792891405 ns/iter 60.837807538315936 ns/iter 1.01
JSON_Equality_Helm_Chart_Lock 152.782312245377 ns/iter 178.18345346351734 ns/iter 0.86
JSON_String_Equal/10 6.263338327166431 ns/iter 7.854126023568973 ns/iter 0.80
JSON_String_Equal/100 6.885777730779239 ns/iter 8.480388116606669 ns/iter 0.81
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9337511433388607 ns/iter 0.625377718458211 ns/iter 1.49
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.918966659948168 ns/iter 14.918859818544984 ns/iter 1.00
JSON_String_Fast_Hash/10 1.9431872145123008 ns/iter 1.9033161840259356 ns/iter 1.02
JSON_String_Fast_Hash/100 1.9443806007434312 ns/iter 1.9052475931576092 ns/iter 1.02
JSON_String_Key_Hash/10 1.244837122397542 ns/iter 1.2440966363957306 ns/iter 1.00
JSON_String_Key_Hash/100 12.435277913621245 ns/iter 12.427495373638774 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 2.4861984543173716 ns/iter 2.796487695394224 ns/iter 0.89
JSON_Object_Defines_Miss_Too_Small 2.4868543091509996 ns/iter 2.798895282264285 ns/iter 0.89
JSON_Object_Defines_Miss_Too_Large 2.4870076587520127 ns/iter 2.7962031516261043 ns/iter 0.89
Regex_Lower_S_Or_Upper_S_Asterisk 3.108226632268728 ns/iter 3.1176246609550176 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 3.1084656821195145 ns/iter 3.1187062766679428 ns/iter 1.00
Regex_Period_Asterisk 3.114880951401549 ns/iter 3.1109378839781883 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 3.110265046331685 ns/iter 3.1115617481908004 ns/iter 1.00
Regex_Period_Plus 3.4234897403838924 ns/iter 3.113211489280092 ns/iter 1.10
Regex_Period 3.421955318195968 ns/iter 3.1098519467170336 ns/iter 1.10
Regex_Caret_Period_Plus_Dollar 3.4199306607141704 ns/iter 3.110864366752792 ns/iter 1.10
Regex_Caret_Group_Period_Plus_Group_Dollar 3.4232370189224075 ns/iter 3.110078731246697 ns/iter 1.10
Regex_Caret_Period_Asterisk_Dollar 4.354678840045552 ns/iter 4.353023889340409 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 4.351493425451091 ns/iter 4.352684406725353 ns/iter 1.00
Regex_Caret_X_Hyphen 13.683123604742615 ns/iter 13.065296690234682 ns/iter 1.05
Regex_Period_Md_Dollar 36.251487229506 ns/iter 36.5015438671608 ns/iter 0.99
Regex_Caret_Slash_Period_Asterisk 9.017420353444619 ns/iter 9.328777816227953 ns/iter 0.97
Regex_Caret_Period_Range_Dollar 3.577096309996102 ns/iter 4.6655084650872825 ns/iter 0.77
Regex_Nested_Backtrack 59.10752254207472 ns/iter 60.04987730614438 ns/iter 0.98

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

@jviotti jviotti marked this pull request as ready for review February 2, 2026 12:51
@jviotti jviotti changed the title [WIP] Optimise wrapping to subschemas with no references Optimise wrapping to subschemas with no references Feb 2, 2026
@augmentcode
Copy link

augmentcode bot commented Feb 2, 2026

🤖 Augment PR Summary

Summary: This PR refactors and optimizes JSON Schema “subschema wrapping” so that wrapping a subschema that contains no references can return the subschema directly.

Changes:

  • Changed the schema-wrapping API to accept an analysed SchemaFrame and a resolved SchemaFrame::Location rather than a raw JSON Pointer + default dialect.
  • Updated wrap() implementation to detect whether the target subschema contains any references and avoid building a $defs/schema wrapper when it does not.
  • Kept the wrapper-based path for subschemas with references, reusing the resolved dialect from the provided location.
  • Minor internal refactor to build the #/$defs/schema path via a WeakPointer.
  • Rewrote/adjusted unit tests to match the new behavior (direct subschema return vs wrapper) and added coverage for direct/nested $ref cases.

Technical Notes: Callers now need to run SchemaFrame::analyse(...) and obtain a Location via frame.traverse(...) before invoking wrap(schema, frame, location, resolver).

🤖 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. 4 suggestions posted.

Fix All in Augment

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

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti merged commit c5f99c7 into main Feb 2, 2026
11 checks passed
@jviotti jviotti deleted the faster-wrap branch February 2, 2026 13:34
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