Skip to content

Add fine grained YAML / JSON file parsing stubs - #2721

Merged
jviotti merged 5 commits into
mainfrom
yaml-win
Aug 11, 2026
Merged

Add fine grained YAML / JSON file parsing stubs#2721
jviotti merged 5 commits into
mainfrom
yaml-win

Conversation

@jviotti

@jviotti jviotti commented Aug 11, 2026

Copy link
Copy Markdown
Member

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

Review in cubic

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

@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: aa6a2da Previous: fc389c7 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.7696144136419714 ns/iter 3.0546660980821922 ns/iter 0.58
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.8321928706923372 ns/iter 3.1538668503408416 ns/iter 0.58
Regex_Period_Asterisk 1.883482624484201 ns/iter 3.06519060906994 ns/iter 0.61
Regex_Group_Period_Asterisk_Group 2.154732944991036 ns/iter 3.0525228952714616 ns/iter 0.71
Regex_Period_Plus 2.3514633865000056 ns/iter 4.107273557388423 ns/iter 0.57
Regex_Period 2.5973223331808377 ns/iter 3.3897210565396514 ns/iter 0.77
Regex_Caret_Period_Plus_Dollar 3.0699658107308867 ns/iter 3.214999048599463 ns/iter 0.95
Regex_Caret_Group_Period_Plus_Group_Dollar 2.3455922079096627 ns/iter 3.149821395720141 ns/iter 0.74
Regex_Caret_Period_Asterisk_Dollar 2.120602796547884 ns/iter 2.9315091042146695 ns/iter 0.72
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.9751885893632661 ns/iter 2.7019843581722496 ns/iter 0.73
Regex_Caret_X_Hyphen 7.195817566191106 ns/iter 8.113240085399644 ns/iter 0.89
Regex_Period_Md_Dollar 22.095253626426693 ns/iter 34.607749798252925 ns/iter 0.64
Regex_Caret_Slash_Period_Asterisk 5.68985952122423 ns/iter 6.125177205762773 ns/iter 0.93
Regex_Caret_Period_Range_Dollar 2.5157237599093483 ns/iter 2.8127471467849317 ns/iter 0.89
Regex_Nested_Backtrack 31.936144100315722 ns/iter 37.49015420123196 ns/iter 0.85
JSON_Array_Of_Objects_Unique 414.32622791221974 ns/iter 383.9339023613377 ns/iter 1.08
JSON_Parse_1 4683.715470559418 ns/iter 4365.54996641063 ns/iter 1.07
JSON_Parse_Real 6987.665106544466 ns/iter 6696.637355356849 ns/iter 1.04
JSON_Parse_Decimal 6892.408356209473 ns/iter 7836.3616229110385 ns/iter 0.88
JSON_Parse_Schema_ISO_Language 2634673.203921439 ns/iter 2935517.662551297 ns/iter 0.90
JSON_Parse_Integer 3905.7067358596146 ns/iter 3967.2706137545047 ns/iter 0.98
JSON_Parse_String_NonSSO_Plain 4071.0582739332954 ns/iter 5373.264579999386 ns/iter 0.76
JSON_Parse_String_SSO_Plain 2272.4769736123576 ns/iter 2221.951578825898 ns/iter 1.02
JSON_Parse_String_Escape_Heavy 21933.134540333653 ns/iter 20149.028063532496 ns/iter 1.09
JSON_Parse_Object_Short_Keys 6759.4912176995995 ns/iter 7557.751056052569 ns/iter 0.89
JSON_Parse_Object_Scalar_Properties 3460.412253360482 ns/iter 3355.703316122925 ns/iter 1.03
JSON_Parse_Object_Array_Properties 4803.910966753505 ns/iter 5369.020773895787 ns/iter 0.89
JSON_Parse_Object_Object_Properties 4909.210175627312 ns/iter 5390.82666000013 ns/iter 0.91
JSON_Parse_Nested_Containers 32963.98777049928 ns/iter 34680.20790300978 ns/iter 0.95
JSON_From_String_Copy 26.986259463109793 ns/iter 26.12437242231141 ns/iter 1.03
JSON_From_String_Temporary 23.445324939943312 ns/iter 24.709664732207578 ns/iter 0.95
JSON_Number_To_Double 43.39035281446607 ns/iter 48.43514132138085 ns/iter 0.90
JSON_Object_At_Last_Key/8 4.697176568378473 ns/iter 7.107951735642139 ns/iter 0.66
JSON_Object_At_Last_Key/32 17.42621824872869 ns/iter 16.371612376426373 ns/iter 1.06
JSON_Object_At_Last_Key/128 61.89152783094359 ns/iter 65.29340065345696 ns/iter 0.95
JSON_Object_At_Last_Key/512 199.3005461551407 ns/iter 235.00300182294745 ns/iter 0.85
JSON_Fast_Hash_Helm_Chart_Lock 63.43230505507853 ns/iter 64.7003764723378 ns/iter 0.98
JSON_Equality_Helm_Chart_Lock 148.25704241007853 ns/iter 160.03149303580025 ns/iter 0.93
JSON_Divisible_By_Decimal 228.93393900707085 ns/iter 225.78955383021557 ns/iter 1.01
JSON_String_Equal/10 7.533156603249649 ns/iter 9.633885732678051 ns/iter 0.78
JSON_String_Equal/100 6.998087483780979 ns/iter 8.707120625830141 ns/iter 0.80
JSON_String_Equal_Small_By_Perfect_Hash/10 0.4413882239410698 ns/iter 0.4440970813547302 ns/iter 0.99
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 4.831000439265341 ns/iter 3.87433181321597 ns/iter 1.25
JSON_String_Fast_Hash/10 3.2935147493734975 ns/iter 2.8027519785718367 ns/iter 1.18
JSON_String_Fast_Hash/100 2.6876233414273467 ns/iter 2.7521260087958663 ns/iter 0.98
JSON_String_Key_Hash/10 1.9072285360116847 ns/iter 2.2902355132293706 ns/iter 0.83
JSON_String_Key_Hash/100 2.6827790705822117 ns/iter 2.9556566402941713 ns/iter 0.91
JSON_Object_Defines_Miss_Same_Length 2.904760769721878 ns/iter 3.5057302734863307 ns/iter 0.83
JSON_Object_Defines_Miss_Too_Small 2.856839771975237 ns/iter 2.975538426430124 ns/iter 0.96
JSON_Object_Defines_Miss_Too_Large 2.8977254197801936 ns/iter 3.363041431686988 ns/iter 0.86
Pointer_Object_Traverse 21.029663286601085 ns/iter 25.352508962994875 ns/iter 0.83
Pointer_Object_Try_Traverse 26.66697268261321 ns/iter 32.731959261363805 ns/iter 0.81
Pointer_Push_Back_Pointer_To_Weak_Pointer 190.57681711900753 ns/iter 221.15433002609095 ns/iter 0.86
Pointer_Walker_Schema_ISO_Language 2827440.524193266 ns/iter 3517371.420814501 ns/iter 0.80
Pointer_Maybe_Tracked_Deeply_Nested/0 871510.3530136013 ns/iter 1189227.314533664 ns/iter 0.73
Pointer_Maybe_Tracked_Deeply_Nested/1 1265164.536496253 ns/iter 1420165.2706183314 ns/iter 0.89
Pointer_Position_Tracker_Get_Deeply_Nested 364.5982289359686 ns/iter 478.78503760427805 ns/iter 0.76
JSONPath_Descendant_Filter_Nested 1341.893153348793 ns/iter 1557.6883484222758 ns/iter 0.86
URITemplateRouter_Create 23788.47603661558 ns/iter 30777.052762287356 ns/iter 0.77
URITemplateRouter_Match 166.85233601281234 ns/iter 200.77682392478377 ns/iter 0.83
URITemplateRouter_Match_BasePath 186.10960406901575 ns/iter 207.97286453981454 ns/iter 0.89
URITemplateRouterView_Restore 13393.22513752759 ns/iter 11078.963085697013 ns/iter 1.21
URITemplateRouterView_Match 133.72788775060354 ns/iter 161.230523498583 ns/iter 0.83
URITemplateRouterView_Match_BasePath 162.4779499433363 ns/iter 183.80814757679835 ns/iter 0.88
URITemplateRouterView_Arguments 516.1607081354013 ns/iter 652.5734548545225 ns/iter 0.79
JSONL_Parse_Large 7691611.111111898 ns/iter 8957814.28571354 ns/iter 0.86
JSONL_Parse_Large_GZIP 9015222.972972903 ns/iter 11037964.376810849 ns/iter 0.82
JSONLD_Catalog_Annotation_List_Populate 1038484.243722323 ns/iter 1552224.475190981 ns/iter 0.67
JSONLD_Catalog_Materialize 3077052.08455895 ns/iter 4872848.958333028 ns/iter 0.63
HTML_Build_Table_100000 39700888.88888767 ns/iter 54866053.57142643 ns/iter 0.72
HTML_Render_Table_100000 1915380.9210524142 ns/iter 2398211.95652169 ns/iter 0.80
GZIP_Compress_ISO_Language_Set_3_Locations 27307923.319999646 ns/iter 40278449.99999957 ns/iter 0.68
GZIP_Decompress_ISO_Language_Set_3_Locations 3337361.049773592 ns/iter 4608327.855262779 ns/iter 0.72
GZIP_Compress_ISO_Language_Set_3_Schema 1482279.8281938597 ns/iter 2469654.264214007 ns/iter 0.60
GZIP_Decompress_ISO_Language_Set_3_Schema 251527.9427027119 ns/iter 389911.4441416865 ns/iter 0.65
JOSE_VerifySignature_RS256 20664.74683544404 ns/iter 38823.00979861055 ns/iter 0.53
JOSE_VerifySignature_ES512 1978131.1058344976 ns/iter 1499684.2227602159 ns/iter 1.32

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: aa6a2da Previous: fc389c7 Ratio
JOSE_VerifySignature_RS256 24857.755806588735 ns/iter 22145.83277242391 ns/iter 1.12
JOSE_VerifySignature_ES512 641531.051328986 ns/iter 577295.1168724538 ns/iter 1.11
GZIP_Compress_ISO_Language_Set_3_Locations 39481043.27777931 ns/iter 36518819.26315893 ns/iter 1.08
GZIP_Decompress_ISO_Language_Set_3_Locations 4098983.128655062 ns/iter 4435597.541401198 ns/iter 0.92
GZIP_Compress_ISO_Language_Set_3_Schema 2282579.7328992994 ns/iter 2019225.1729106433 ns/iter 1.13
GZIP_Decompress_ISO_Language_Set_3_Schema 277884.9728059441 ns/iter 378225.8029157347 ns/iter 0.73
HTML_Build_Table_100000 73145801.59999195 ns/iter 58915427.08333948 ns/iter 1.24
HTML_Render_Table_100000 2186166.546875157 ns/iter 2022783.0404625342 ns/iter 1.08
JSONLD_Catalog_Annotation_List_Populate 1420141.877300733 ns/iter 1386967.090909078 ns/iter 1.02
JSONLD_Catalog_Materialize 5178952.598591525 ns/iter 4446754.149999777 ns/iter 1.16
JSONL_Parse_Large 9750909.666665722 ns/iter 10532445.34848442 ns/iter 0.93
JSONL_Parse_Large_GZIP 11185610.730158549 ns/iter 11904944.966102187 ns/iter 0.94
URITemplateRouter_Create 29714.281864097855 ns/iter 31368.330954188164 ns/iter 0.95
URITemplateRouter_Match 150.39594476279945 ns/iter 157.4516838194594 ns/iter 0.96
URITemplateRouter_Match_BasePath 178.8538372660397 ns/iter 183.1074973135205 ns/iter 0.98
URITemplateRouterView_Restore 9907.063926687637 ns/iter 8584.408458454798 ns/iter 1.15
URITemplateRouterView_Match 124.59159539617292 ns/iter 124.89837867692346 ns/iter 1.00
URITemplateRouterView_Match_BasePath 142.7554415225036 ns/iter 144.02167204742506 ns/iter 0.99
URITemplateRouterView_Arguments 465.57235802368155 ns/iter 479.1918576126425 ns/iter 0.97
JSONPath_Descendant_Filter_Nested 1752.7920835310576 ns/iter 1710.640267734795 ns/iter 1.02
Pointer_Object_Traverse 24.84279545738621 ns/iter 23.839796514821 ns/iter 1.04
Pointer_Object_Try_Traverse 28.507135070963628 ns/iter 26.51647281281557 ns/iter 1.08
Pointer_Push_Back_Pointer_To_Weak_Pointer 153.4086234974812 ns/iter 158.36125333286807 ns/iter 0.97
Pointer_Walker_Schema_ISO_Language 2646301.3754645204 ns/iter 2628192.2649256536 ns/iter 1.01
Pointer_Maybe_Tracked_Deeply_Nested/0 1213896.602075968 ns/iter 1200174.9571917981 ns/iter 1.01
Pointer_Maybe_Tracked_Deeply_Nested/1 1652442.271428559 ns/iter 1801291.1855672058 ns/iter 0.92
Pointer_Position_Tracker_Get_Deeply_Nested 423.34625720753434 ns/iter 404.4642551010024 ns/iter 1.05
JSON_Array_Of_Objects_Unique 460.34845185520516 ns/iter 475.82264174742136 ns/iter 0.97
JSON_Parse_1 5371.753129220375 ns/iter 5514.509064591187 ns/iter 0.97
JSON_Parse_Real 5488.474284908361 ns/iter 5604.7844555441325 ns/iter 0.98
JSON_Parse_Decimal 8742.225100123638 ns/iter 10421.47171984606 ns/iter 0.84
JSON_Parse_Schema_ISO_Language 3740229.1871654247 ns/iter 3792170.766304352 ns/iter 0.99
JSON_Parse_Integer 3765.178714859367 ns/iter 3808.9025350364195 ns/iter 0.99
JSON_Parse_String_NonSSO_Plain 5366.215408972615 ns/iter 5404.581792208861 ns/iter 0.99
JSON_Parse_String_SSO_Plain 2840.3997975094157 ns/iter 3121.2513834485553 ns/iter 0.91
JSON_Parse_String_Escape_Heavy 18513.414367711805 ns/iter 19882.586542336077 ns/iter 0.93
JSON_Parse_Object_Short_Keys 8745.429249761683 ns/iter 8509.918296191428 ns/iter 1.03
JSON_Parse_Object_Scalar_Properties 4484.137717757892 ns/iter 4420.964752395079 ns/iter 1.01
JSON_Parse_Object_Array_Properties 6693.378642725883 ns/iter 6799.492077797313 ns/iter 0.98
JSON_Parse_Object_Object_Properties 6663.209360567169 ns/iter 6923.684803188266 ns/iter 0.96
JSON_Parse_Nested_Containers 50392.81550000396 ns/iter 49847.454461496185 ns/iter 1.01
JSON_From_String_Copy 19.181769238879347 ns/iter 17.698044639919516 ns/iter 1.08
JSON_From_String_Temporary 16.006549834519813 ns/iter 15.391108956577293 ns/iter 1.04
JSON_Number_To_Double 19.792901274320833 ns/iter 20.883499654062046 ns/iter 0.95
JSON_Object_At_Last_Key/8 4.1978781016996605 ns/iter 3.7465534094152395 ns/iter 1.12
JSON_Object_At_Last_Key/32 13.832031655686954 ns/iter 11.936847550878783 ns/iter 1.16
JSON_Object_At_Last_Key/128 47.4929085249912 ns/iter 48.79882201533854 ns/iter 0.97
JSON_Object_At_Last_Key/512 280.8929059351994 ns/iter 358.7075775822038 ns/iter 0.78
JSON_Fast_Hash_Helm_Chart_Lock 94.90214388957413 ns/iter 86.90204123061059 ns/iter 1.09
JSON_Equality_Helm_Chart_Lock 153.67416379630689 ns/iter 147.88050743773837 ns/iter 1.04
JSON_Divisible_By_Decimal 261.2889524232141 ns/iter 264.69754738557504 ns/iter 0.99
JSON_String_Equal/10 5.408388231479099 ns/iter 5.413751498490344 ns/iter 1.00
JSON_String_Equal/100 6.114605843240272 ns/iter 6.03850479779993 ns/iter 1.01
JSON_String_Equal_Small_By_Perfect_Hash/10 0.711270273470068 ns/iter 0.6244318119762967 ns/iter 1.14
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 22.099262258671665 ns/iter 25.201642617355166 ns/iter 0.88
JSON_String_Fast_Hash/10 2.9485607353139494 ns/iter 2.610152581407365 ns/iter 1.13
JSON_String_Fast_Hash/100 2.945273768342533 ns/iter 2.618574707339364 ns/iter 1.12
JSON_String_Key_Hash/10 1.0854738165840858 ns/iter 1.2471667106062703 ns/iter 0.87
JSON_String_Key_Hash/100 14.794667681057637 ns/iter 12.445968746768541 ns/iter 1.19
JSON_Object_Defines_Miss_Same_Length 3.531617913304517 ns/iter 3.114212935150748 ns/iter 1.13
JSON_Object_Defines_Miss_Too_Small 3.166590027410236 ns/iter 3.1171605833298854 ns/iter 1.02
JSON_Object_Defines_Miss_Too_Large 3.172087802077715 ns/iter 3.1146954743898787 ns/iter 1.02
Regex_Lower_S_Or_Upper_S_Asterisk 0.7034578659440032 ns/iter 0.6238002552238083 ns/iter 1.13
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.0598018585511186 ns/iter 0.934274918815456 ns/iter 1.13
Regex_Period_Asterisk 0.7035107458752942 ns/iter 0.6231163467559954 ns/iter 1.13
Regex_Group_Period_Asterisk_Group 1.0558245476351296 ns/iter 0.952224766676107 ns/iter 1.11
Regex_Period_Plus 0.7051905481697349 ns/iter 0.6234327155252535 ns/iter 1.13
Regex_Period 1.0559857095219172 ns/iter 0.9348959235465065 ns/iter 1.13
Regex_Caret_Period_Plus_Dollar 0.7057565221402028 ns/iter 0.6232537665783181 ns/iter 1.13
Regex_Caret_Group_Period_Plus_Group_Dollar 1.056061840522089 ns/iter 0.9356315442610833 ns/iter 1.13
Regex_Caret_Period_Asterisk_Dollar 0.703821008100419 ns/iter 0.6233799269536755 ns/iter 1.13
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.0554625815703889 ns/iter 0.9351687950337042 ns/iter 1.13
Regex_Caret_X_Hyphen 3.5156360108904003 ns/iter 3.7426355865528014 ns/iter 0.94
Regex_Period_Md_Dollar 32.40278971620409 ns/iter 30.277955773641207 ns/iter 1.07
Regex_Caret_Slash_Period_Asterisk 3.8746447745218355 ns/iter 4.047159248170985 ns/iter 0.96
Regex_Caret_Period_Range_Dollar 1.7581694231904088 ns/iter 1.5581882535493434 ns/iter 1.13
Regex_Nested_Backtrack 40.48390177573041 ns/iter 39.45452076941342 ns/iter 1.03

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: aa6a2da Previous: fc389c7 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.1869886958790676 ns/iter 2.2248621588282056 ns/iter 0.98
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.1779354673433664 ns/iter 2.1930925111066073 ns/iter 0.99
Regex_Period_Asterisk 2.178330581053373 ns/iter 2.198532523009095 ns/iter 0.99
Regex_Group_Period_Asterisk_Group 2.1790449601186563 ns/iter 2.2184472013419425 ns/iter 0.98
Regex_Period_Plus 3.111718698662779 ns/iter 3.113479253353276 ns/iter 1.00
Regex_Period 2.8157885481719527 ns/iter 2.802861229201509 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 2.8020692041853503 ns/iter 2.80319880083152 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 3.1153693801266455 ns/iter 3.1165391504429993 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 3.4234608453823707 ns/iter 2.8553799021688633 ns/iter 1.20
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.1273360643453136 ns/iter 2.2425156276747535 ns/iter 1.39
Regex_Caret_X_Hyphen 6.5431112129425015 ns/iter 5.615962348924818 ns/iter 1.17
Regex_Period_Md_Dollar 29.43949357154395 ns/iter 28.617054211254874 ns/iter 1.03
Regex_Caret_Slash_Period_Asterisk 7.16263221090266 ns/iter 6.246133182346642 ns/iter 1.15
Regex_Caret_Period_Range_Dollar 3.7366748416045894 ns/iter 3.7516959287272535 ns/iter 1.00
Regex_Nested_Backtrack 38.769352443392606 ns/iter 38.26358915513199 ns/iter 1.01
JSON_Array_Of_Objects_Unique 403.2501785511715 ns/iter 455.0543559166023 ns/iter 0.89
JSON_Parse_1 4926.412399720794 ns/iter 4787.755938873542 ns/iter 1.03
JSON_Parse_Real 5176.127262569538 ns/iter 5115.2180942080395 ns/iter 1.01
JSON_Parse_Decimal 7654.814459414747 ns/iter 7308.818138834854 ns/iter 1.05
JSON_Parse_Schema_ISO_Language 3576090.229592071 ns/iter 3477489.0099017713 ns/iter 1.03
JSON_Parse_Integer 3884.146255844033 ns/iter 3659.575299604783 ns/iter 1.06
JSON_Parse_String_NonSSO_Plain 5123.094483693185 ns/iter 5025.17121024205 ns/iter 1.02
JSON_Parse_String_SSO_Plain 2778.885102312906 ns/iter 2738.3579817786667 ns/iter 1.01
JSON_Parse_String_Escape_Heavy 14748.227625441856 ns/iter 16133.982797461693 ns/iter 0.91
JSON_Parse_Object_Short_Keys 8423.607093134227 ns/iter 7856.066121082008 ns/iter 1.07
JSON_Parse_Object_Scalar_Properties 4345.240486986325 ns/iter 4211.067107794803 ns/iter 1.03
JSON_Parse_Object_Array_Properties 5806.328090800104 ns/iter 5604.545457454846 ns/iter 1.04
JSON_Parse_Object_Object_Properties 5881.922088021157 ns/iter 5603.930939455393 ns/iter 1.05
JSON_Parse_Nested_Containers 45422.64217439212 ns/iter 44588.52306419584 ns/iter 1.02
JSON_From_String_Copy 19.93160987451015 ns/iter 19.30946044004661 ns/iter 1.03
JSON_From_String_Temporary 17.46343791646326 ns/iter 17.136965442324527 ns/iter 1.02
JSON_Number_To_Double 24.012180637412122 ns/iter 23.371827478725542 ns/iter 1.03
JSON_Object_At_Last_Key/8 3.8481195085007176 ns/iter 3.8997853989482874 ns/iter 0.99
JSON_Object_At_Last_Key/32 12.480915674874026 ns/iter 15.012066275373856 ns/iter 0.83
JSON_Object_At_Last_Key/128 49.38300868038796 ns/iter 49.33385929960438 ns/iter 1.00
JSON_Object_At_Last_Key/512 394.67295505971117 ns/iter 394.0026003443006 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 61.045274384806 ns/iter 54.48501550964085 ns/iter 1.12
JSON_Equality_Helm_Chart_Lock 156.381220401681 ns/iter 152.57811995114284 ns/iter 1.02
JSON_Divisible_By_Decimal 257.4373000096528 ns/iter 245.67148167646963 ns/iter 1.05
JSON_String_Equal/10 5.608659189150759 ns/iter 5.950861479921385 ns/iter 0.94
JSON_String_Equal/100 6.247773952701395 ns/iter 6.5456825521252116 ns/iter 0.95
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9355673296598177 ns/iter 0.9348311730826024 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.935886386951069 ns/iter 10.588827715456599 ns/iter 1.41
JSON_String_Fast_Hash/10 2.4900133594451397 ns/iter 2.179727625916848 ns/iter 1.14
JSON_String_Fast_Hash/100 2.490773213867456 ns/iter 2.1874557156934156 ns/iter 1.14
JSON_String_Key_Hash/10 2.7068614700264995 ns/iter 2.181673361172599 ns/iter 1.24
JSON_String_Key_Hash/100 9.025702673454438 ns/iter 6.5395487685327645 ns/iter 1.38
JSON_Object_Defines_Miss_Same_Length 3.4253543642480277 ns/iter 3.4246446735093587 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.0729469989311893 ns/iter 2.985461048872461 ns/iter 1.03
JSON_Object_Defines_Miss_Too_Large 2.6410018997191056 ns/iter 2.6622357097620575 ns/iter 0.99
Pointer_Object_Traverse 29.025264676665454 ns/iter 28.767317184547238 ns/iter 1.01
Pointer_Object_Try_Traverse 31.174642425328557 ns/iter 30.912811470564844 ns/iter 1.01
Pointer_Push_Back_Pointer_To_Weak_Pointer 225.65593873265047 ns/iter 188.7318399615645 ns/iter 1.20
Pointer_Walker_Schema_ISO_Language 2552071.7627737247 ns/iter 2657527.315018725 ns/iter 0.96
Pointer_Maybe_Tracked_Deeply_Nested/0 1251194.8478261128 ns/iter 1271260.7605120619 ns/iter 0.98
Pointer_Maybe_Tracked_Deeply_Nested/1 1634904.4476190298 ns/iter 1656124.7387173544 ns/iter 0.99
Pointer_Position_Tracker_Get_Deeply_Nested 656.8526377045505 ns/iter 678.4723576130306 ns/iter 0.97
JSONPath_Descendant_Filter_Nested 1636.4583930802685 ns/iter 1586.1960237080405 ns/iter 1.03
URITemplateRouter_Create 33318.2048504834 ns/iter 31258.51571023358 ns/iter 1.07
URITemplateRouter_Match 181.51035871154014 ns/iter 172.16704827469135 ns/iter 1.05
URITemplateRouter_Match_BasePath 207.7507647198231 ns/iter 199.27638257681872 ns/iter 1.04
URITemplateRouterView_Restore 8544.31584121596 ns/iter 8504.943856763552 ns/iter 1.00
URITemplateRouterView_Match 139.59730158836362 ns/iter 140.71001497340006 ns/iter 0.99
URITemplateRouterView_Match_BasePath 163.27983200108068 ns/iter 163.21828660651084 ns/iter 1.00
URITemplateRouterView_Arguments 426.7563764035453 ns/iter 429.80708267423785 ns/iter 0.99
JSONL_Parse_Large 10000905.699999813 ns/iter 9917696.464789271 ns/iter 1.01
JSONL_Parse_Large_GZIP 11583232.616667753 ns/iter 11442230.967215108 ns/iter 1.01
JSONLD_Catalog_Annotation_List_Populate 1332531.9392788687 ns/iter 1312238.2232646951 ns/iter 1.02
JSONLD_Catalog_Materialize 4332720.664596202 ns/iter 4242334.579268251 ns/iter 1.02
HTML_Build_Table_100000 64883114.363634706 ns/iter 64335435.54544485 ns/iter 1.01
HTML_Render_Table_100000 5392165.424000268 ns/iter 5275722.8854959225 ns/iter 1.02
GZIP_Compress_ISO_Language_Set_3_Locations 33336422.249999486 ns/iter 32553960.71428896 ns/iter 1.02
GZIP_Decompress_ISO_Language_Set_3_Locations 4164363.9940475845 ns/iter 4386588.171974217 ns/iter 0.95
GZIP_Compress_ISO_Language_Set_3_Schema 1882365.3951612478 ns/iter 1860806.6515954074 ns/iter 1.01
GZIP_Decompress_ISO_Language_Set_3_Schema 353966.64086997404 ns/iter 358780.80256411637 ns/iter 0.99
JOSE_VerifySignature_RS256 57986.815852743755 ns/iter 59870.22366498354 ns/iter 0.97
JOSE_VerifySignature_ES512 2401009.171232891 ns/iter 2433741.9442508053 ns/iter 0.99

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

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

@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.

All reported issues were addressed across 4 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread src/core/json/json.cc Outdated
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@augmentcode

augmentcode Bot commented Aug 11, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR expands regression coverage for fine-grained YAML and JSON parsing from file streams.

Changes:

  • Adds a JSON multi-document fixture and verifies successive `parse_json` calls resume correctly.
  • Adds YAML fixtures for LF, CRLF, BOM-prefixed, object, and blank-line/comment-separated documents.
  • Exercises YAML parsing from normal text-mode and explicitly binary `ifstream` streams.
  • Checks document-by-document stream advancement, end-of-stream handling, and unread trailing content.
  • Adds callback parsing coverage across successive YAML documents.
  • Covers an existing tag-directive multi-document fixture through a file stream.
  • Marks line-ending-sensitive fixtures with `-text` to preserve their committed bytes across checkouts.
Technical Notes: The PR adds tests and fixtures only; production parser and I/O implementations are unchanged.

🤖 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. No suggestions at this time.

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

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

@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 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/lang/io/include/sourcemeta/core/io.h">

<violation number="1" location="src/lang/io/include/sourcemeta/core/io.h:217">
P1: Parsing from a normal text-mode `std::ifstream` can resume at the wrong position on platforms with CRLF translation, breaking multi-document parsing; adding a binary mode to `read_file` does not protect callers that pass their own streams. Retaining the reported position and advancing with `ignore` preserves the existing generic-stream behavior.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

}

stream.clear();
stream.seekg(start + static_cast<std::streamoff>(count));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: Parsing from a normal text-mode std::ifstream can resume at the wrong position on platforms with CRLF translation, breaking multi-document parsing; adding a binary mode to read_file does not protect callers that pass their own streams. Retaining the reported position and advancing with ignore preserves the existing generic-stream behavior.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/lang/io/include/sourcemeta/core/io.h, line 217:

<comment>Parsing from a normal text-mode `std::ifstream` can resume at the wrong position on platforms with CRLF translation, breaking multi-document parsing; adding a binary mode to `read_file` does not protect callers that pass their own streams. Retaining the reported position and advancing with `ignore` preserves the existing generic-stream behavior.</comment>

<file context>
@@ -207,13 +213,8 @@ auto resume_stream(std::basic_istream<CharT, Traits> &stream,
   stream.clear();
-  stream.seekg(start);
-  stream.ignore(count);
+  stream.seekg(start + static_cast<std::streamoff>(count));
 }
 
</file context>
Suggested change
stream.seekg(start + static_cast<std::streamoff>(count));
stream.seekg(start);
stream.ignore(count);

@jviotti
jviotti merged commit f0936ad into main Aug 11, 2026
13 checks passed
@jviotti
jviotti deleted the yaml-win branch August 11, 2026 16:43

@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: aa6a2da Previous: fc389c7 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 5.576068000000305 ns/iter 5.425459821428344 ns/iter 1.03
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 5.0562509999986105 ns/iter 5.0590941305921096 ns/iter 1.00
Regex_Period_Asterisk 5.0941535714283 ns/iter 5.104387999999744 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 5.161829464285007 ns/iter 5.054161000000477 ns/iter 1.02
Regex_Period_Plus 4.978134999998929 ns/iter 4.868225469836302 ns/iter 1.02
Regex_Period 5.1992410000002565 ns/iter 5.204688999999689 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 4.989826000000903 ns/iter 4.800841987678609 ns/iter 1.04
Regex_Caret_Group_Period_Plus_Group_Dollar 5.061242679701781 ns/iter 5.047064331483153 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 5.475547321428362 ns/iter 5.410693000001174 ns/iter 1.01
Regex_Caret_Group_Period_Asterisk_Group_Dollar 5.084152678571335 ns/iter 5.262053000001288 ns/iter 0.97
Regex_Caret_X_Hyphen 9.149063616073404 ns/iter 8.931970942268793 ns/iter 1.02
Regex_Period_Md_Dollar 44.7891208054606 ns/iter 44.83889832230484 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 8.308966034334508 ns/iter 8.386270089287352 ns/iter 0.99
Regex_Caret_Period_Range_Dollar 6.120280357143721 ns/iter 6.069878571429805 ns/iter 1.01
Regex_Nested_Backtrack 55.63924999999016 ns/iter 55.60815000001185 ns/iter 1.00
JSON_Array_Of_Objects_Unique 599.8874999999008 ns/iter 593.3207142855881 ns/iter 1.01
JSON_Parse_1 8889.367458178567 ns/iter 9081.515261091805 ns/iter 0.98
JSON_Parse_Real 16658.13616071432 ns/iter 16205.444196429093 ns/iter 1.03
JSON_Parse_Decimal 11921.293749999506 ns/iter 12092.21785714476 ns/iter 0.99
JSON_Parse_Schema_ISO_Language 7595882.222221917 ns/iter 7779382.222222213 ns/iter 0.98
JSON_Parse_Integer 6401.903571427527 ns/iter 6297.361607142956 ns/iter 1.02
JSON_Parse_String_NonSSO_Plain 8057.251116070521 ns/iter 7924.844866070861 ns/iter 1.02
JSON_Parse_String_SSO_Plain 3776.239397321746 ns/iter 3814.370510052188 ns/iter 0.99
JSON_Parse_String_Escape_Heavy 21874.84687500074 ns/iter 21853.50386714841 ns/iter 1.00
JSON_Parse_Object_Short_Keys 13375.324440516535 ns/iter 13262.01936598232 ns/iter 1.01
JSON_Parse_Object_Scalar_Properties 6859.762499999532 ns/iter 6915.899999999705 ns/iter 0.99
JSON_Parse_Object_Array_Properties 11424.719642860737 ns/iter 11783.770312501218 ns/iter 0.97
JSON_Parse_Object_Object_Properties 11844.35357142531 ns/iter 11487.130357145199 ns/iter 1.03
JSON_Parse_Nested_Containers 78508.0022321186 ns/iter 79692.89062500653 ns/iter 0.99
JSON_From_String_Copy 64.60789062501249 ns/iter 64.96506250000168 ns/iter 0.99
JSON_From_String_Temporary 60.454348214286874 ns/iter 58.383750000002365 ns/iter 1.04
JSON_Number_To_Double 120.3620781249981 ns/iter 122.1754464285953 ns/iter 0.99
JSON_Object_At_Last_Key/8 7.342349107143978 ns/iter 7.409984374999417 ns/iter 0.99
JSON_Object_At_Last_Key/32 24.294974059211516 ns/iter 23.435624738440332 ns/iter 1.04
JSON_Object_At_Last_Key/128 90.10546472742297 ns/iter 95.4808906250193 ns/iter 0.94
JSON_Object_At_Last_Key/512 431.8174558642684 ns/iter 428.8880156744723 ns/iter 1.01
JSON_Fast_Hash_Helm_Chart_Lock 103.18313378645048 ns/iter 103.20754896396319 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 221.66599999998485 ns/iter 211.90909375000896 ns/iter 1.05
JSON_Divisible_By_Decimal 300.2950513063901 ns/iter 298.2521698379942 ns/iter 1.01
JSON_String_Equal/10 10.373145312499334 ns/iter 10.502970312501247 ns/iter 0.99
JSON_String_Equal/100 11.762519642855652 ns/iter 11.772295312500347 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 2.524503571428178 ns/iter 2.543919841478517 ns/iter 0.99
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 15.166571428569648 ns/iter 15.040759754282705 ns/iter 1.01
JSON_String_Fast_Hash/10 6.618287946429697 ns/iter 6.662385714284776 ns/iter 0.99
JSON_String_Fast_Hash/100 6.889433035715748 ns/iter 6.6205345982136725 ns/iter 1.04
JSON_String_Key_Hash/10 5.470801785715399 ns/iter 5.342722999998841 ns/iter 1.02
JSON_String_Key_Hash/100 11.922021875001576 ns/iter 11.906046428569946 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.8912131696428838 ns/iter 3.8144363839278026 ns/iter 1.02
JSON_Object_Defines_Miss_Too_Small 4.336474819492507 ns/iter 4.1105010919137115 ns/iter 1.05
JSON_Object_Defines_Miss_Too_Large 3.7900596360885292 ns/iter 3.8204673601018793 ns/iter 0.99
Pointer_Object_Traverse 67.89689285712696 ns/iter 67.79635714285145 ns/iter 1.00
Pointer_Object_Try_Traverse 71.637848214274 ns/iter 70.77965401785592 ns/iter 1.01
Pointer_Push_Back_Pointer_To_Weak_Pointer 164.67106683065393 ns/iter 161.46562241956454 ns/iter 1.02
Pointer_Walker_Schema_ISO_Language 11419970.312498862 ns/iter 12771287.500003478 ns/iter 0.89
Pointer_Maybe_Tracked_Deeply_Nested/0 2425976.136363901 ns/iter 2498099.598393405 ns/iter 0.97
Pointer_Maybe_Tracked_Deeply_Nested/1 3744979.6791443173 ns/iter 3800425.5813964233 ns/iter 0.99
Pointer_Position_Tracker_Get_Deeply_Nested 532.0835010927166 ns/iter 558.595424107062 ns/iter 0.95
JSONPath_Descendant_Filter_Nested 2537.6334293373534 ns/iter 2356.6594233710107 ns/iter 1.08
URITemplateRouter_Create 41631.487499998344 ns/iter 41095.12276785513 ns/iter 1.01
URITemplateRouter_Match 239.4252857142679 ns/iter 235.2195942834733 ns/iter 1.02
URITemplateRouter_Match_BasePath 284.77147835841413 ns/iter 266.1434359885229 ns/iter 1.07
URITemplateRouterView_Restore 34460.98532790135 ns/iter 33397.74602239234 ns/iter 1.03
URITemplateRouterView_Match 191.54624031663556 ns/iter 184.43002539553288 ns/iter 1.04
URITemplateRouterView_Match_BasePath 218.99111299146261 ns/iter 213.34960654692844 ns/iter 1.03
URITemplateRouterView_Arguments 563.855446428566 ns/iter 538.8963392856487 ns/iter 1.05
JSONL_Parse_Large 33369685.714292463 ns/iter 33351890.47618856 ns/iter 1.00
JSONL_Parse_Large_GZIP 35966523.80952037 ns/iter 33876395.45454394 ns/iter 1.06
JSONLD_Catalog_Annotation_List_Populate 3550600.0000006314 ns/iter 3294254.460093136 ns/iter 1.08
JSONLD_Catalog_Materialize 8645514.444444617 ns/iter 9620409.33333204 ns/iter 0.90
HTML_Build_Table_100000 100459285.71428573 ns/iter 93300428.57144299 ns/iter 1.08
HTML_Render_Table_100000 8585765.333333863 ns/iter 7964321.111110925 ns/iter 1.08
GZIP_Compress_ISO_Language_Set_3_Locations 38287468.42105159 ns/iter 35961715.789474174 ns/iter 1.06
GZIP_Decompress_ISO_Language_Set_3_Locations 10149512.000001172 ns/iter 10466281.250000264 ns/iter 0.97
GZIP_Compress_ISO_Language_Set_3_Schema 2185836.811594382 ns/iter 2135101.7391304555 ns/iter 1.02
GZIP_Decompress_ISO_Language_Set_3_Schema 631498.7499998941 ns/iter 638014.1071429892 ns/iter 0.99
JOSE_VerifySignature_RS256 23543.199999998877 ns/iter 22249.787500001617 ns/iter 1.06
JOSE_VerifySignature_ES512 1459601.004016183 ns/iter 1437610.642570127 ns/iter 1.02

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