Skip to content

Prototype a new HTTP module with a few utilities#2471

Merged
jviotti merged 5 commits into
mainfrom
http-module
Jun 6, 2026
Merged

Prototype a new HTTP module with a few utilities#2471
jviotti merged 5 commits into
mainfrom
http-module

Conversation

@jviotti
Copy link
Copy Markdown
Member

@jviotti jviotti commented Jun 5, 2026

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

Copy link
Copy Markdown

@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: 931b202 Previous: bb90cb3 Ratio
GZIP_Compress_ISO_Language_Set_3_Locations 40048909.29411765 ns/iter 40073677.882353015 ns/iter 1.00
GZIP_Decompress_ISO_Language_Set_3_Locations 4699921.173333148 ns/iter 4546699.322580597 ns/iter 1.03
GZIP_Compress_ISO_Language_Set_3_Schema 2301241.4835526547 ns/iter 2305697.950657796 ns/iter 1.00
GZIP_Decompress_ISO_Language_Set_3_Schema 292162.36686944094 ns/iter 295242.94888476067 ns/iter 0.99
HTML_Build_Table_100000 72925052.69999765 ns/iter 71862116.59999913 ns/iter 1.01
HTML_Render_Table_100000 2160683.366972376 ns/iter 1988293.268907557 ns/iter 1.09
JSONL_Parse_Large 14838178.829786267 ns/iter 14798102.382978916 ns/iter 1.00
JSONL_Parse_Large_GZIP 16218104.209302023 ns/iter 16170395.674418274 ns/iter 1.00
URITemplateRouter_Create 29725.60416489325 ns/iter 30329.019706770243 ns/iter 0.98
URITemplateRouter_Match 161.29954052493105 ns/iter 158.845196359146 ns/iter 1.02
URITemplateRouter_Match_BasePath 189.92618493379473 ns/iter 188.0133222937121 ns/iter 1.01
URITemplateRouterView_Restore 8680.976097783827 ns/iter 8682.493100007521 ns/iter 1.00
URITemplateRouterView_Match 125.48487895637348 ns/iter 125.42358442614231 ns/iter 1.00
URITemplateRouterView_Match_BasePath 143.78059131933492 ns/iter 143.8725522255597 ns/iter 1.00
URITemplateRouterView_Arguments 537.5988035086655 ns/iter 452.4255112367267 ns/iter 1.19
Pointer_Object_Traverse 34.41559723704958 ns/iter 34.21019278445585 ns/iter 1.01
Pointer_Object_Try_Traverse 22.33156846453581 ns/iter 22.0487190148383 ns/iter 1.01
Pointer_Push_Back_Pointer_To_Weak_Pointer 135.7986151577287 ns/iter 150.398016761434 ns/iter 0.90
Pointer_Walker_Schema_ISO_Language 3423823.7263680412 ns/iter 3524754.9405941037 ns/iter 0.97
Pointer_Maybe_Tracked_Deeply_Nested/0 1871683.5215054401 ns/iter 1875970.3396227756 ns/iter 1.00
Pointer_Maybe_Tracked_Deeply_Nested/1 1867991.8879997784 ns/iter 1865042.7306665732 ns/iter 1.00
Pointer_Position_Tracker_Get_Deeply_Nested 590.928713359583 ns/iter 440.84631883578504 ns/iter 1.34
JSON_Array_Of_Objects_Unique 442.2412796133552 ns/iter 414.9094421787993 ns/iter 1.07
JSON_Parse_1 9786.068432117892 ns/iter 9729.669510515092 ns/iter 1.01
JSON_Parse_Real 13134.282648992697 ns/iter 13330.78715469041 ns/iter 0.99
JSON_Parse_Decimal 17206.000074000476 ns/iter 17090.34455469683 ns/iter 1.01
JSON_Parse_Schema_ISO_Language 5707357.845527973 ns/iter 5671673.601626033 ns/iter 1.01
JSON_Fast_Hash_Helm_Chart_Lock 77.73762146388827 ns/iter 61.41477485367042 ns/iter 1.27
JSON_Equality_Helm_Chart_Lock 174.36489543649628 ns/iter 179.67436691877302 ns/iter 0.97
JSON_Divisible_By_Decimal 230.55108369184603 ns/iter 230.74893792085703 ns/iter 1.00
JSON_String_Equal/10 6.116583352915322 ns/iter 6.111612689137907 ns/iter 1.00
JSON_String_Equal/100 6.891722473035637 ns/iter 6.8540258305172905 ns/iter 1.01
JSON_String_Equal_Small_By_Perfect_Hash/10 0.7092731000448197 ns/iter 0.7128272968989428 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 21.947585338825395 ns/iter 21.933850363746785 ns/iter 1.00
JSON_String_Fast_Hash/10 1.7987011935585095 ns/iter 1.7583352299052208 ns/iter 1.02
JSON_String_Fast_Hash/100 1.7572803935239574 ns/iter 1.7605782123663791 ns/iter 1.00
JSON_String_Key_Hash/10 1.0860032755551492 ns/iter 1.0864903096603722 ns/iter 1.00
JSON_String_Key_Hash/100 14.795399067314035 ns/iter 14.762406098711546 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.8684793541106925 ns/iter 3.870010599737187 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.5172547929233495 ns/iter 3.5188248440728787 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 4.219928994400501 ns/iter 4.223009282111892 ns/iter 1.00
Regex_Lower_S_Or_Upper_S_Asterisk 0.7038397599764411 ns/iter 0.7032668225890677 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 0.7279328970526076 ns/iter 0.7035010160691376 ns/iter 1.03
Regex_Period_Asterisk 1.0595890515101671 ns/iter 1.0566995616342463 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 1.0561564718708196 ns/iter 1.0553089955988482 ns/iter 1.00
Regex_Period_Plus 0.703081462706273 ns/iter 0.7033052914891464 ns/iter 1.00
Regex_Period 0.7086705335510938 ns/iter 0.7038600735987719 ns/iter 1.01
Regex_Caret_Period_Plus_Dollar 1.0552273507015217 ns/iter 1.0556576650169285 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 1.055820910032438 ns/iter 1.0559622880287292 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 0.7037619321989496 ns/iter 0.7035348025448284 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 0.7059453313372109 ns/iter 0.703478384020237 ns/iter 1.00
Regex_Caret_X_Hyphen 3.516268805210224 ns/iter 3.518107646566931 ns/iter 1.00
Regex_Period_Md_Dollar 32.87963823666903 ns/iter 34.71089541522642 ns/iter 0.95
Regex_Caret_Slash_Period_Asterisk 4.571500645421007 ns/iter 4.573605145559772 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 0.8456330395345852 ns/iter 0.8389726149866171 ns/iter 1.01
Regex_Nested_Backtrack 39.09339053140872 ns/iter 38.67094132809596 ns/iter 1.01

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

Copy link
Copy Markdown

@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: 931b202 Previous: bb90cb3 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.2563975210521616 ns/iter 2.2285863118712426 ns/iter 1.01
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.193640867339601 ns/iter 2.2034379566290614 ns/iter 1.00
Regex_Period_Asterisk 2.1867486420420486 ns/iter 2.1968433163761114 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 2.1913091040456707 ns/iter 2.1941804948211696 ns/iter 1.00
Regex_Period_Plus 2.8249792262119877 ns/iter 2.801408081646223 ns/iter 1.01
Regex_Period 2.8014231263841958 ns/iter 2.8017166612844915 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 2.504451915099365 ns/iter 2.497569346456128 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 2.489839476017665 ns/iter 2.4912530872205707 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 3.423871302245295 ns/iter 3.4229868058901602 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.423323465839285 ns/iter 3.4231596752263984 ns/iter 1.00
Regex_Caret_X_Hyphen 6.541199097073728 ns/iter 6.540731816703877 ns/iter 1.00
Regex_Period_Md_Dollar 27.96005426628557 ns/iter 28.85057886878768 ns/iter 0.97
Regex_Caret_Slash_Period_Asterisk 7.157268108732453 ns/iter 6.227795463542678 ns/iter 1.15
Regex_Caret_Period_Range_Dollar 3.734227807626622 ns/iter 2.842615360032428 ns/iter 1.31
Regex_Nested_Backtrack 37.08436154492156 ns/iter 37.385195317427424 ns/iter 0.99
JSON_Array_Of_Objects_Unique 458.33909690606515 ns/iter 458.03154364140363 ns/iter 1.00
JSON_Parse_1 6973.96976068009 ns/iter 6878.115819816252 ns/iter 1.01
JSON_Parse_Real 11951.725292931189 ns/iter 11716.420703593398 ns/iter 1.02
JSON_Parse_Decimal 11210.000031977926 ns/iter 11307.535421593544 ns/iter 0.99
JSON_Parse_Schema_ISO_Language 3864930.134078253 ns/iter 3852691.651933676 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 72.49205009461733 ns/iter 66.29494632661861 ns/iter 1.09
JSON_Equality_Helm_Chart_Lock 173.28958551706654 ns/iter 182.208189323364 ns/iter 0.95
JSON_Divisible_By_Decimal 256.40669100209493 ns/iter 249.77195026986809 ns/iter 1.03
JSON_String_Equal/10 6.54358900431857 ns/iter 6.547589263698662 ns/iter 1.00
JSON_String_Equal/100 7.168939486287828 ns/iter 7.1748100037591795 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9396529414203983 ns/iter 0.956393936672705 ns/iter 0.98
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 10.653075574137231 ns/iter 10.660120538000303 ns/iter 1.00
JSON_String_Fast_Hash/10 3.1147741472972412 ns/iter 3.1139959048385237 ns/iter 1.00
JSON_String_Fast_Hash/100 3.115632061574827 ns/iter 3.115480108749333 ns/iter 1.00
JSON_String_Key_Hash/10 2.1806871333010145 ns/iter 2.1805482285540814 ns/iter 1.00
JSON_String_Key_Hash/100 6.535182362691545 ns/iter 6.539416902577785 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 2.630093143673547 ns/iter 2.6430892720238526 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 2.8151934154441824 ns/iter 2.6745958483028027 ns/iter 1.05
JSON_Object_Defines_Miss_Too_Large 3.737849818874189 ns/iter 3.734866778544062 ns/iter 1.00
Pointer_Object_Traverse 27.12987077139762 ns/iter 26.425413814962518 ns/iter 1.03
Pointer_Object_Try_Traverse 28.292743427951724 ns/iter 28.284713359292976 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 160.9397135657165 ns/iter 154.10642033692315 ns/iter 1.04
Pointer_Walker_Schema_ISO_Language 3048055.817391346 ns/iter 3018619.2337659085 ns/iter 1.01
Pointer_Maybe_Tracked_Deeply_Nested/0 1485428.3938731193 ns/iter 1487122.6765956422 ns/iter 1.00
Pointer_Maybe_Tracked_Deeply_Nested/1 1836084.307692195 ns/iter 1837249.535433306 ns/iter 1.00
Pointer_Position_Tracker_Get_Deeply_Nested 666.8080589040725 ns/iter 662.6637693979831 ns/iter 1.01
URITemplateRouter_Create 31295.067862227515 ns/iter 32051.330887048418 ns/iter 0.98
URITemplateRouter_Match 171.70143992354528 ns/iter 173.14967320116213 ns/iter 0.99
URITemplateRouter_Match_BasePath 195.18735682353358 ns/iter 201.00381988693368 ns/iter 0.97
URITemplateRouterView_Restore 7840.254835996314 ns/iter 7270.604541009915 ns/iter 1.08
URITemplateRouterView_Match 147.02566855277732 ns/iter 142.91836656958276 ns/iter 1.03
URITemplateRouterView_Match_BasePath 161.72018773323936 ns/iter 161.05108206363815 ns/iter 1.00
URITemplateRouterView_Arguments 430.90673313758623 ns/iter 436.94634971789236 ns/iter 0.99
JSONL_Parse_Large 12073632.206897072 ns/iter 11717151.033334024 ns/iter 1.03
JSONL_Parse_Large_GZIP 13324593.698113842 ns/iter 13044657.500000978 ns/iter 1.02
HTML_Build_Table_100000 62967808.00000141 ns/iter 67336840.454552 ns/iter 0.94
HTML_Render_Table_100000 5154732.69924803 ns/iter 5132135.810219094 ns/iter 1.00
GZIP_Compress_ISO_Language_Set_3_Locations 33680728.09524035 ns/iter 33874045.23809458 ns/iter 0.99
GZIP_Decompress_ISO_Language_Set_3_Locations 4469855.529031696 ns/iter 4508738.085106506 ns/iter 0.99
GZIP_Compress_ISO_Language_Set_3_Schema 1873722.3360213644 ns/iter 1875653.8686326512 ns/iter 1.00
GZIP_Decompress_ISO_Language_Set_3_Schema 377280.87432578596 ns/iter 377584.67152105 ns/iter 1.00

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

Copy link
Copy Markdown

@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: 931b202 Previous: bb90cb3 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.9817594491451591 ns/iter 2.788132195482511 ns/iter 0.71
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.7011176617192587 ns/iter 2.0216445602969246 ns/iter 0.84
Regex_Period_Asterisk 1.7202523261885674 ns/iter 2.015880849665416 ns/iter 0.85
Regex_Group_Period_Asterisk_Group 1.7012243901110815 ns/iter 2.364314509626668 ns/iter 0.72
Regex_Period_Plus 2.029942460168291 ns/iter 2.717453343389575 ns/iter 0.75
Regex_Period 1.9960953799005847 ns/iter 2.6622626316825393 ns/iter 0.75
Regex_Caret_Period_Plus_Dollar 2.0403071111598843 ns/iter 2.2476255359802435 ns/iter 0.91
Regex_Caret_Group_Period_Plus_Group_Dollar 2.0095471357705814 ns/iter 2.373985056690553 ns/iter 0.85
Regex_Caret_Period_Asterisk_Dollar 1.69549681906707 ns/iter 2.217293189749316 ns/iter 0.76
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.7214287652197995 ns/iter 2.127787531895823 ns/iter 0.81
Regex_Caret_X_Hyphen 6.042488010491876 ns/iter 7.163635478976159 ns/iter 0.84
Regex_Period_Md_Dollar 17.092196199054385 ns/iter 21.2369501713085 ns/iter 0.80
Regex_Caret_Slash_Period_Asterisk 4.347656693543196 ns/iter 5.859221257584773 ns/iter 0.74
Regex_Caret_Period_Range_Dollar 2.051688175021056 ns/iter 2.492322608467318 ns/iter 0.82
Regex_Nested_Backtrack 25.060794067772996 ns/iter 33.59883861214793 ns/iter 0.75
JSON_Array_Of_Objects_Unique 419.9878319654577 ns/iter 475.7767011699389 ns/iter 0.88
JSON_Parse_1 4682.02182723998 ns/iter 5794.874045983073 ns/iter 0.81
JSON_Parse_Real 7119.261844955671 ns/iter 7292.389407158998 ns/iter 0.98
JSON_Parse_Decimal 7994.999826834661 ns/iter 8718.684418331077 ns/iter 0.92
JSON_Parse_Schema_ISO_Language 3184792.159763728 ns/iter 3107405.2511416683 ns/iter 1.02
JSON_Fast_Hash_Helm_Chart_Lock 57.57072109895838 ns/iter 61.66411045808204 ns/iter 0.93
JSON_Equality_Helm_Chart_Lock 132.01780790784883 ns/iter 133.43750642959787 ns/iter 0.99
JSON_Divisible_By_Decimal 174.73999609382633 ns/iter 181.72251284465375 ns/iter 0.96
JSON_String_Equal/10 6.601488999391976 ns/iter 6.782418440729838 ns/iter 0.97
JSON_String_Equal/100 6.473489251198302 ns/iter 6.930578987038801 ns/iter 0.93
JSON_String_Equal_Small_By_Perfect_Hash/10 0.7524533371250289 ns/iter 0.8585439863697184 ns/iter 0.88
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.2808277133682946 ns/iter 3.7949563080477775 ns/iter 0.86
JSON_String_Fast_Hash/10 2.408199973395812 ns/iter 2.8491731560569105 ns/iter 0.85
JSON_String_Fast_Hash/100 1.9804854492399313 ns/iter 2.4296174934657566 ns/iter 0.82
JSON_String_Key_Hash/10 1.357125694781982 ns/iter 1.5893882901824763 ns/iter 0.85
JSON_String_Key_Hash/100 2.133042296602911 ns/iter 2.5011668560493034 ns/iter 0.85
JSON_Object_Defines_Miss_Same_Length 2.3650082375668138 ns/iter 2.737306445925965 ns/iter 0.86
JSON_Object_Defines_Miss_Too_Small 2.363192269083174 ns/iter 2.5272712084386404 ns/iter 0.94
JSON_Object_Defines_Miss_Too_Large 2.3099564989433863 ns/iter 2.9106821642710887 ns/iter 0.79
Pointer_Object_Traverse 14.50430892579834 ns/iter 18.439639853530533 ns/iter 0.79
Pointer_Object_Try_Traverse 22.923668652438334 ns/iter 24.762822091610698 ns/iter 0.93
Pointer_Push_Back_Pointer_To_Weak_Pointer 157.79748417684658 ns/iter 191.479498911245 ns/iter 0.82
Pointer_Walker_Schema_ISO_Language 4687834.158940914 ns/iter 5241877.707316404 ns/iter 0.89
Pointer_Maybe_Tracked_Deeply_Nested/0 970937.9195400309 ns/iter 1411089.4082333986 ns/iter 0.69
Pointer_Maybe_Tracked_Deeply_Nested/1 1398094.0643865375 ns/iter 1931416.3172269987 ns/iter 0.72
Pointer_Position_Tracker_Get_Deeply_Nested 353.3383436605398 ns/iter 413.5110454800743 ns/iter 0.85
URITemplateRouter_Create 22605.011305954762 ns/iter 25515.565399646268 ns/iter 0.89
URITemplateRouter_Match 163.0211119594983 ns/iter 201.0812749356165 ns/iter 0.81
URITemplateRouter_Match_BasePath 189.0065080423365 ns/iter 205.10156939749646 ns/iter 0.92
URITemplateRouterView_Restore 9490.160056373032 ns/iter 10545.000368514662 ns/iter 0.90
URITemplateRouterView_Match 130.07474667523132 ns/iter 139.50414500534478 ns/iter 0.93
URITemplateRouterView_Match_BasePath 144.57209038096119 ns/iter 163.65510595744882 ns/iter 0.88
URITemplateRouterView_Arguments 403.3328903300414 ns/iter 433.11477494488474 ns/iter 0.93
JSONL_Parse_Large 13883869.053570053 ns/iter 15371961.956519876 ns/iter 0.90
JSONL_Parse_Large_GZIP 13700075.840001773 ns/iter 14863624.086956406 ns/iter 0.92
HTML_Build_Table_100000 64643106.00001061 ns/iter 72009858.39999703 ns/iter 0.90
HTML_Render_Table_100000 2753369.9095026734 ns/iter 3591283.76436763 ns/iter 0.77
GZIP_Compress_ISO_Language_Set_3_Locations 27859441.640002843 ns/iter 30313615.956520546 ns/iter 0.92
GZIP_Decompress_ISO_Language_Set_3_Locations 5844575.829999031 ns/iter 6483857.9833330335 ns/iter 0.90
GZIP_Compress_ISO_Language_Set_3_Schema 1565142.478458295 ns/iter 1955228.818615731 ns/iter 0.80
GZIP_Decompress_ISO_Language_Set_3_Schema 281833.6007222521 ns/iter 339858.565259095 ns/iter 0.83

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

Copy link
Copy Markdown

@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: 931b202 Previous: bb90cb3 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 5.086896000000252 ns/iter 5.058572321429113 ns/iter 1.01
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 5.2463535714285365 ns/iter 5.033563392856877 ns/iter 1.04
Regex_Period_Asterisk 5.1923630000010235 ns/iter 5.049624999999196 ns/iter 1.03
Regex_Group_Period_Asterisk_Group 5.074663000000328 ns/iter 5.028489999999692 ns/iter 1.01
Regex_Period_Plus 4.883372568054273 ns/iter 4.705226796217032 ns/iter 1.04
Regex_Period 4.7046714072994105 ns/iter 4.7580391528472115 ns/iter 0.99
Regex_Caret_Period_Plus_Dollar 4.705831249998888 ns/iter 4.733373224852091 ns/iter 0.99
Regex_Caret_Group_Period_Plus_Group_Dollar 4.703023671212348 ns/iter 4.8422337161668745 ns/iter 0.97
Regex_Caret_Period_Asterisk_Dollar 5.024462499999263 ns/iter 5.0471539999989545 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 5.084170535714146 ns/iter 5.031417635052518 ns/iter 1.01
Regex_Caret_X_Hyphen 8.871310674681673 ns/iter 8.507866033447451 ns/iter 1.04
Regex_Period_Md_Dollar 47.05428292411147 ns/iter 45.90016387590307 ns/iter 1.03
Regex_Caret_Slash_Period_Asterisk 8.32837496281962 ns/iter 8.220231026785692 ns/iter 1.01
Regex_Caret_Period_Range_Dollar 5.9749473214277975 ns/iter 5.679631249999976 ns/iter 1.05
Regex_Nested_Backtrack 59.465446428573294 ns/iter 56.700883928572566 ns/iter 1.05
JSON_Array_Of_Objects_Unique 528.7562500001286 ns/iter 528.1635000001188 ns/iter 1.00
JSON_Parse_1 11901.771875002965 ns/iter 11859.095312498623 ns/iter 1.00
JSON_Parse_Real 19213.283154316723 ns/iter 18553.403155382075 ns/iter 1.04
JSON_Parse_Decimal 18420.34393163845 ns/iter 18123.27939695948 ns/iter 1.02
JSON_Parse_Schema_ISO_Language 7470720.535715307 ns/iter 7846817.777779809 ns/iter 0.95
JSON_Fast_Hash_Helm_Chart_Lock 71.12178571428984 ns/iter 71.08962053570573 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 321.8557065399127 ns/iter 313.1698660714578 ns/iter 1.03
JSON_Divisible_By_Decimal 304.24553571423627 ns/iter 302.10195958681527 ns/iter 1.01
JSON_String_Equal/10 17.63951801463581 ns/iter 17.30370015450075 ns/iter 1.02
JSON_String_Equal/100 16.868119306688854 ns/iter 16.769794530559977 ns/iter 1.01
JSON_String_Equal_Small_By_Perfect_Hash/10 2.564066738782471 ns/iter 2.522227142856894 ns/iter 1.02
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 15.23898214286033 ns/iter 15.059718013124227 ns/iter 1.01
JSON_String_Fast_Hash/10 5.080356999999367 ns/iter 5.029877000001761 ns/iter 1.01
JSON_String_Fast_Hash/100 6.061864999999216 ns/iter 5.038988392858609 ns/iter 1.20
JSON_String_Key_Hash/10 6.3895720000004985 ns/iter 5.354158035714818 ns/iter 1.19
JSON_String_Key_Hash/100 18.831238713185584 ns/iter 16.31920948893399 ns/iter 1.15
JSON_Object_Defines_Miss_Same_Length 4.933012511011634 ns/iter 4.098782609777717 ns/iter 1.20
JSON_Object_Defines_Miss_Too_Small 5.233230589828664 ns/iter 4.122506614504462 ns/iter 1.27
JSON_Object_Defines_Miss_Too_Large 5.64826900000071 ns/iter 4.4046037499995805 ns/iter 1.28
Pointer_Object_Traverse 77.92365178571816 ns/iter 61.13307142858356 ns/iter 1.27
Pointer_Object_Try_Traverse 86.18936383929362 ns/iter 71.76100446427216 ns/iter 1.20
Pointer_Push_Back_Pointer_To_Weak_Pointer 215.4369835211638 ns/iter 165.18597981159476 ns/iter 1.30
Pointer_Walker_Schema_ISO_Language 15094389.285715286 ns/iter 13494301.785714567 ns/iter 1.12
Pointer_Maybe_Tracked_Deeply_Nested/0 2819946.1864414075 ns/iter 2508745.338982446 ns/iter 1.12
Pointer_Maybe_Tracked_Deeply_Nested/1 4402201.807228683 ns/iter 3831503.351954409 ns/iter 1.15
Pointer_Position_Tracker_Get_Deeply_Nested 756.7746431272003 ns/iter 678.780580357038 ns/iter 1.11
URITemplateRouter_Create 51831.15248107705 ns/iter 43558.25624999455 ns/iter 1.19
URITemplateRouter_Match 270.14128571425186 ns/iter 218.0664880327393 ns/iter 1.24
URITemplateRouter_Match_BasePath 303.2358212841732 ns/iter 249.63007142860405 ns/iter 1.21
URITemplateRouterView_Restore 40582.46102748085 ns/iter 33289.77116479622 ns/iter 1.22
URITemplateRouterView_Match 190.8616020666675 ns/iter 156.50299107140393 ns/iter 1.22
URITemplateRouterView_Match_BasePath 242.57499809935697 ns/iter 176.09704750646884 ns/iter 1.38
URITemplateRouterView_Arguments 773.366852678592 ns/iter 525.3440000001319 ns/iter 1.47
JSONL_Parse_Large 42216142.10526145 ns/iter 36879778.94737502 ns/iter 1.14
JSONL_Parse_Large_GZIP 44720716.666675895 ns/iter 35727268.421049684 ns/iter 1.25
HTML_Build_Table_100000 110300866.6666483 ns/iter 93982099.9999808 ns/iter 1.17
HTML_Render_Table_100000 8390751.78571339 ns/iter 8361103.333332822 ns/iter 1.00
GZIP_Compress_ISO_Language_Set_3_Locations 51058629.41176757 ns/iter 41448729.41175409 ns/iter 1.23
GZIP_Decompress_ISO_Language_Set_3_Locations 11928976.562501248 ns/iter 11175007.142855164 ns/iter 1.07
GZIP_Compress_ISO_Language_Set_3_Schema 2715905.3511704803 ns/iter 2336522.4999999157 ns/iter 1.16
GZIP_Decompress_ISO_Language_Set_3_Schema 757454.484605057 ns/iter 668987.7678571829 ns/iter 1.13

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

@jviotti jviotti force-pushed the http-module branch 3 times, most recently from f84f697 to 2044469 Compare June 5, 2026 23:12
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti changed the title [WIP] Prototype a new HTTP module Prototype a new HTTP module Jun 5, 2026
@jviotti jviotti marked this pull request as ready for review June 5, 2026 23:18
@jviotti jviotti changed the title Prototype a new HTTP module Prototype a new HTTP module with a few utilities Jun 5, 2026
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Jun 5, 2026

🤖 Augment PR Summary

Summary: This PR prototypes a new sourcemeta::core::http module with small, reusable HTTP parsing/formatting primitives.

Changes:

  • Adds a new optional CMake component (SOURCEMETA_CORE_HTTP) and wires it into top-level build/test and package config generation.
  • Introduces HTTP helpers for content negotiation (Accept, Accept-Language, Accept-Encoding) and HTTP-date parsing.
  • Adds formatting helpers for RFC 8288 Link / multi-Link headers.
  • Adds RFC 9457 Problem Details builder (http_make_problem_details) plus a typed set of common HTTP status codes.
  • Adds a comprehensive new unit test suite for the HTTP module and updates the packaging find_package test to consume the new headers/target.
  • Updates website CI workflows to explicitly disable building the new HTTP component.

Technical Notes: The new library links publicly against sourcemeta::core::json and privately against sourcemeta::core::time, and is exposed via <sourcemeta/core/http.h> plus auxiliary headers for status codes and Problem Details.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@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. 5 suggestions posted.

Fix All in Augment

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

Comment thread src/core/http/negotiate_encoding.cc Outdated
}
} else if (token == "identity") {
identity_listed = true;
if (quality == 0.0f) {
Copy link
Copy Markdown

@augmentcode augmentcode Bot Jun 5, 2026

Choose a reason for hiding this comment

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

identity_excluded (and wildcard_excluded) is set if any duplicate entry has q=0, which makes identity/wildcard effectively impossible even if another duplicate has q>0; this seems to diverge from “max q across duplicates” behavior for Accept-Encoding lists.

Severity: medium

Fix This in Augment

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

Comment thread src/core/http/negotiate_encoding.cc Outdated
http_for_each_accept_entry(
accept_encoding_header,
[&](const std::string_view token, const float quality) {
if (token == "gzip" || token == "x-gzip") {
Copy link
Copy Markdown

@augmentcode augmentcode Bot Jun 5, 2026

Choose a reason for hiding this comment

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

Accept-Encoding tokens are case-insensitive; comparing token verbatim against "gzip"/"identity"/"*" will miss valid inputs like "GZip" or "IDENTITY".

Severity: low

Fix This in Augment

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

Comment thread src/core/http/match_accept.cc Outdated
auto media_specificity(const std::string_view range,
const std::string_view candidate) noexcept
-> std::uint8_t {
if (range == candidate) {
Copy link
Copy Markdown

@augmentcode augmentcode Bot Jun 5, 2026

Choose a reason for hiding this comment

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

Media types in Accept are case-insensitive; the equality/prefix checks in media_specificity are currently case-sensitive, so headers like "Text/HTML" wouldn’t match "text/html" candidates.

Severity: medium

Fix This in Augment

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

Comment thread src/core/http/match_accept_language.cc Outdated
if (range == "*") {
return 1;
}
if (range == candidate) {
Copy link
Copy Markdown

@augmentcode augmentcode Bot Jun 5, 2026

Choose a reason for hiding this comment

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

Language tags/ranges are case-insensitive (BCP 47 / HTTP); range == candidate and range.starts_with(candidate) being case-sensitive can cause valid inputs like "EN-us" to fail to match "en".

Severity: medium

Fix This in Augment

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

Comment thread src/core/http/problem.cc Outdated

auto http_make_problem_details(const HTTPProblemDetails &fields)
-> sourcemeta::core::JSON {
assert(fields.status.code >= 100 && fields.status.code <= 599);
Copy link
Copy Markdown

@augmentcode augmentcode Bot Jun 5, 2026

Choose a reason for hiding this comment

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

http_make_problem_details relies on assert for validating fields.status; in release builds a default-initialized HTTPProblemDetails (or otherwise invalid HTTPStatus) could silently produce an invalid Problem Details payload (e.g., status 0 / empty title).

Severity: medium

Fix This in Augment

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

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

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

3 issues found across 27 files

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread src/core/http/match_accept.cc Outdated
Comment thread src/core/http/helpers.h Outdated
Comment thread src/core/http/include/sourcemeta/core/http_status.h Outdated
jviotti added 3 commits June 5, 2026 19:35
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 d50aab1 into main Jun 6, 2026
13 checks passed
@jviotti jviotti deleted the http-module branch June 6, 2026 00:16
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