Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize relativize() as reference_visit() #1504

Merged
merged 1 commit into from
Jan 29, 2025
Merged

Conversation

jviotti
Copy link
Member

@jviotti jviotti commented Jan 29, 2025

Signed-off-by: Juan Cruz Viotti [email protected]

@jviotti jviotti force-pushed the for-each-reference branch from 3276bb4 to ecaef83 Compare January 29, 2025 19:21
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)

Benchmark suite Current: 8ff60cf Previous: 1257bcd Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.5790000759494898 ns/iter 1.6242845443964553 ns/iter 0.97
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.6238991338653062 ns/iter 1.62502555568287 ns/iter 1.00
Regex_Period_Asterisk 1.6149889036488823 ns/iter 1.622499673363136 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 1.6640684203051344 ns/iter 1.6238151160451513 ns/iter 1.02
Regex_Period_Plus 1.9316989865073397 ns/iter 1.9451339990160716 ns/iter 0.99
Regex_Period 1.9789938642382785 ns/iter 1.9534369697853329 ns/iter 1.01
Regex_Caret_Period_Plus_Dollar 1.9584152833941173 ns/iter 1.9633298920162394 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 1.9683691334711912 ns/iter 1.9477453562108746 ns/iter 1.01
Regex_Caret_Period_Asterisk_Dollar 1.6531774864512312 ns/iter 1.622410727080435 ns/iter 1.02
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.6408749075917377 ns/iter 1.6324873128085118 ns/iter 1.01
Regex_Caret_X_Hyphen 6.88688482705323 ns/iter 6.811802070955476 ns/iter 1.01
Regex_Period_Md_Dollar 70.16548182477342 ns/iter 69.70843315133743 ns/iter 1.01
Regex_Caret_Slash_Period_Asterisk 5.184480937185739 ns/iter 5.20808304942807 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 2.3279444699636316 ns/iter 2.2738404350183 ns/iter 1.02
Regex_Nested_Backtrack 749.1717261824867 ns/iter 749.175204166856 ns/iter 1.00
JSON_Array_Of_Objects_Unique 358.7499008940746 ns/iter 339.19625607073755 ns/iter 1.06
JSON_Parse_1 21677.244256831276 ns/iter 22336.549090328874 ns/iter 0.97
JSON_Fast_Hash_Helm_Chart_Lock 50.11956552160066 ns/iter 50.39685420000524 ns/iter 0.99
JSON_Equality_Helm_Chart_Lock 123.85280261899779 ns/iter 123.07386589409097 ns/iter 1.01
JSON_String_Equal/10 8.016678300468758 ns/iter 7.7912150726090665 ns/iter 1.03
JSON_String_Equal/100 6.184955313874789 ns/iter 6.181523996244418 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 0.3258678407585896 ns/iter 0.3258073992922958 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.061715758072144 ns/iter 3.0037047353187116 ns/iter 1.02
JSON_String_Fast_Hash/10 1.65666551655472 ns/iter 1.6223881575700625 ns/iter 1.02
JSON_String_Fast_Hash/100 1.9462153511319675 ns/iter 1.9462895786067127 ns/iter 1.00
JSON_String_Key_Hash/10 1.263575483421482 ns/iter 1.2966909302510439 ns/iter 0.97
JSON_String_Key_Hash/100 1.3259292271451437 ns/iter 1.2970551377198365 ns/iter 1.02
JSON_Object_Defines_Miss_Same_Length 2.335036869889501 ns/iter 2.271712336590028 ns/iter 1.03
JSON_Object_Defines_Miss_Too_Small 2.303494341324153 ns/iter 2.272053646905853 ns/iter 1.01
JSON_Object_Defines_Miss_Too_Large 2.290375551219016 ns/iter 2.2769966015672507 ns/iter 1.01
Pointer_Object_Traverse 17.40181574489736 ns/iter 17.537894980485266 ns/iter 0.99
Pointer_Object_Try_Traverse 23.2424146179075 ns/iter 22.51325369929288 ns/iter 1.03
Pointer_Push_Back_Pointer_To_Weak_Pointer 181.69508894445914 ns/iter 179.1921423341727 ns/iter 1.01

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)

Benchmark suite Current: 8ff60cf Previous: 1257bcd Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.2035821660524664 ns/iter 2.205439895388263 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.204883565041548 ns/iter 2.2126817072631573 ns/iter 1.00
Regex_Period_Asterisk 2.1935048001025494 ns/iter 2.2034129072151956 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 2.208805161301759 ns/iter 2.213023754340643 ns/iter 1.00
Regex_Period_Plus 2.490812969578491 ns/iter 2.4860243981552057 ns/iter 1.00
Regex_Period 2.489226750065349 ns/iter 2.487332853235051 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 2.4962476166864915 ns/iter 2.4864510430072015 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 2.5014359361693512 ns/iter 2.4887675853391213 ns/iter 1.01
Regex_Caret_Period_Asterisk_Dollar 2.20732888086649 ns/iter 2.4861564142463153 ns/iter 0.89
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.195915930260941 ns/iter 2.4859757167804397 ns/iter 0.88
Regex_Caret_X_Hyphen 13.059230512489258 ns/iter 12.545757840382844 ns/iter 1.04
Regex_Period_Md_Dollar 81.290436932409 ns/iter 81.93226215139974 ns/iter 0.99
Regex_Caret_Slash_Period_Asterisk 5.600621578362225 ns/iter 5.5975533577868966 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 2.8004421620990474 ns/iter 3.109692667794566 ns/iter 0.90
Regex_Nested_Backtrack 503.4564769999861 ns/iter 498.7616609403319 ns/iter 1.01
JSON_Array_Of_Objects_Unique 407.21874417554267 ns/iter 403.8794275729227 ns/iter 1.01
JSON_Parse_1 30351.68356075303 ns/iter 30355.308840811966 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 59.239258283025855 ns/iter 59.397387661783384 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 168.13777575885018 ns/iter 152.3325775459292 ns/iter 1.10
JSON_String_Equal/10 6.858356920272936 ns/iter 6.278630441306394 ns/iter 1.09
JSON_String_Equal/100 7.46936114007683 ns/iter 6.844555140583583 ns/iter 1.09
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9345352321368611 ns/iter 0.9349485886262672 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.601164964647698 ns/iter 14.596761932766306 ns/iter 1.00
JSON_String_Fast_Hash/10 2.491046098050543 ns/iter 2.4905365115606246 ns/iter 1.00
JSON_String_Fast_Hash/100 2.490090536610315 ns/iter 2.485866395952339 ns/iter 1.00
JSON_String_Key_Hash/10 2.648004682230388 ns/iter 2.689432798418405 ns/iter 0.98
JSON_String_Key_Hash/100 1.8687336863735833 ns/iter 1.8681679855168551 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.7432448414503434 ns/iter 3.7388454434520777 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.735482157992506 ns/iter 3.7326965893851694 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.736357114113856 ns/iter 3.7505857611722533 ns/iter 1.00
Pointer_Object_Traverse 44.300482141228755 ns/iter 44.38106578275717 ns/iter 1.00
Pointer_Object_Try_Traverse 52.34558046037792 ns/iter 52.27888260706735 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 289.7493130016089 ns/iter 305.27287609245764 ns/iter 0.95

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 (windows/msvc)

Benchmark suite Current: 8ff60cf Previous: 1257bcd Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 7.483058035714205 ns/iter 6.871592633928003 ns/iter 1.09
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 7.029415178571189 ns/iter 6.895277901785489 ns/iter 1.02
Regex_Period_Asterisk 6.985927455355677 ns/iter 7.614353537436987 ns/iter 0.92
Regex_Group_Period_Asterisk_Group 13.944609982391556 ns/iter 6.916473214284886 ns/iter 2.02
Regex_Period_Plus 7.1489386160727975 ns/iter 7.235312500001154 ns/iter 0.99
Regex_Period 7.1425781250005524 ns/iter 7.431838169643815 ns/iter 0.96
Regex_Caret_Period_Plus_Dollar 7.313993303570093 ns/iter 7.424514285714524 ns/iter 0.99
Regex_Caret_Group_Period_Plus_Group_Dollar 7.190770089286401 ns/iter 7.2622868303590895 ns/iter 0.99
Regex_Caret_Period_Asterisk_Dollar 6.876541294644766 ns/iter 7.008048183000505 ns/iter 0.98
Regex_Caret_Group_Period_Asterisk_Group_Dollar 7.020049107142919 ns/iter 6.838024553569459 ns/iter 1.03
Regex_Caret_X_Hyphen 14.268065561306372 ns/iter 14.253828284581564 ns/iter 1.00
Regex_Period_Md_Dollar 150.8297544642545 ns/iter 150.70595982145107 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 10.38299821428268 ns/iter 10.442409375002626 ns/iter 0.99
Regex_Caret_Period_Range_Dollar 7.522595982142175 ns/iter 7.601148437499055 ns/iter 0.99
Regex_Nested_Backtrack 617.9439285714595 ns/iter 613.0490178571384 ns/iter 1.01
JSON_Array_Of_Objects_Unique 494.16293409533205 ns/iter 487.9731047266473 ns/iter 1.01
JSON_Parse_1 81231.29770992893 ns/iter 80341.9196428631 ns/iter 1.01
JSON_Fast_Hash_Helm_Chart_Lock 67.49694642857256 ns/iter 63.768937500015 ns/iter 1.06
JSON_Equality_Helm_Chart_Lock 189.35999012141218 ns/iter 186.75857723832897 ns/iter 1.01
JSON_String_Equal/10 8.989982102724566 ns/iter 8.97046986607007 ns/iter 1.00
JSON_String_Equal/100 10.105615624997455 ns/iter 9.896705312960087 ns/iter 1.02
JSON_String_Equal_Small_By_Perfect_Hash/10 2.1818668750000825 ns/iter 2.1649006250001435 ns/iter 1.01
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.837538963139727 ns/iter 14.583394768417666 ns/iter 1.02
JSON_String_Fast_Hash/10 4.0253031768306595 ns/iter 4.029120185765581 ns/iter 1.00
JSON_String_Fast_Hash/100 4.028464962551582 ns/iter 4.02546451611665 ns/iter 1.00
JSON_String_Key_Hash/10 8.01411826779337 ns/iter 7.736486607142926 ns/iter 1.04
JSON_String_Key_Hash/100 4.031873400056386 ns/iter 4.018915736607097 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.721425529068612 ns/iter 3.712352671942207 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 4.956387999998242 ns/iter 4.960622077000618 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.4219561099605666 ns/iter 3.4072256303244104 ns/iter 1.00
Pointer_Object_Traverse 49.26367042903593 ns/iter 49.056687500004564 ns/iter 1.00
Pointer_Object_Try_Traverse 67.94295758927 ns/iter 67.76957589284142 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 159.70716517854962 ns/iter 170.63824803384645 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/gcc)

Benchmark suite Current: 8ff60cf Previous: 1257bcd Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 3.0273880384123566 ns/iter 1.9531142180088146 ns/iter 1.55
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 3.025514027359552 ns/iter 1.9498255446131942 ns/iter 1.55
Regex_Period_Asterisk 3.4603034439453846 ns/iter 1.9779014130368056 ns/iter 1.75
Regex_Group_Period_Asterisk_Group 3.0656373009600832 ns/iter 1.9509459980409456 ns/iter 1.57
Regex_Period_Plus 3.514907938332701 ns/iter 1.9621694685633304 ns/iter 1.79
Regex_Period 2.511093382805741 ns/iter 1.949194914185844 ns/iter 1.29
Regex_Caret_Period_Plus_Dollar 2.220213819027823 ns/iter 1.9527610996306506 ns/iter 1.14
Regex_Caret_Group_Period_Plus_Group_Dollar 2.5628950446046277 ns/iter 1.9511618218346114 ns/iter 1.31
Regex_Caret_Period_Asterisk_Dollar 2.1295434889948264 ns/iter 1.9427383078363005 ns/iter 1.10
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.663311816794334 ns/iter 2.278289086454607 ns/iter 1.61
Regex_Caret_X_Hyphen 7.95305137959975 ns/iter 6.152429629480925 ns/iter 1.29
Regex_Period_Md_Dollar 88.90429310226513 ns/iter 73.45754822765414 ns/iter 1.21
Regex_Caret_Slash_Period_Asterisk 8.974996520809658 ns/iter 4.3973732440260225 ns/iter 2.04
Regex_Caret_Period_Range_Dollar 3.90365959068894 ns/iter 1.9452588904485049 ns/iter 2.01
Regex_Nested_Backtrack 1665.8958525495516 ns/iter 823.475558385263 ns/iter 2.02
JSON_Array_Of_Objects_Unique 276.72457455334177 ns/iter 197.1921061149052 ns/iter 1.40
JSON_Parse_1 30584.17492196006 ns/iter 22784.70619556691 ns/iter 1.34
JSON_Fast_Hash_Helm_Chart_Lock 33.089205779375035 ns/iter 23.579894551111536 ns/iter 1.40
JSON_Equality_Helm_Chart_Lock 178.12878310694583 ns/iter 114.10370617442618 ns/iter 1.56
JSON_String_Equal/10 8.904168178587065 ns/iter 5.386388274571394 ns/iter 1.65
JSON_String_Equal/100 9.055008531687747 ns/iter 5.056697923911345 ns/iter 1.79
JSON_String_Equal_Small_By_Perfect_Hash/10 1.3300116284278376 ns/iter 0.744421713776442 ns/iter 1.79
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 5.355731957213197 ns/iter 3.4459626026403023 ns/iter 1.55
JSON_String_Fast_Hash/10 2.4210464730860033 ns/iter 1.8910378419897973 ns/iter 1.28
JSON_String_Fast_Hash/100 2.1635721332736715 ns/iter 1.8918060223814475 ns/iter 1.14
JSON_String_Key_Hash/10 1.6619763456541659 ns/iter 1.4571920086559111 ns/iter 1.14
JSON_String_Key_Hash/100 2.3088360765328235 ns/iter 1.919586164786371 ns/iter 1.20
JSON_Object_Defines_Miss_Same_Length 1.955055684483249 ns/iter 1.72887396665273 ns/iter 1.13
JSON_Object_Defines_Miss_Too_Small 2.6998921287801454 ns/iter 1.9600240064695464 ns/iter 1.38
JSON_Object_Defines_Miss_Too_Large 1.9336503693548694 ns/iter 1.729811086743139 ns/iter 1.12
Pointer_Object_Traverse 70.84345960168056 ns/iter 54.385964188424914 ns/iter 1.30
Pointer_Object_Try_Traverse 53.414297103881836 ns/iter 36.15190856917258 ns/iter 1.48
Pointer_Push_Back_Pointer_To_Weak_Pointer 236.13954875147093 ns/iter 154.00825395065823 ns/iter 1.53

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)

Benchmark suite Current: 8ff60cf Previous: 1257bcd Ratio
Pointer_Object_Traverse 45.64768437643133 ns/iter 46.72699325767282 ns/iter 0.98
Pointer_Object_Try_Traverse 26.27036335187654 ns/iter 26.188059629886595 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 145.70085719895437 ns/iter 145.2481230307094 ns/iter 1.00
JSON_Array_Of_Objects_Unique 431.69783222282206 ns/iter 415.3623936739927 ns/iter 1.04
JSON_Parse_1 33012.69975408973 ns/iter 33661.15866928358 ns/iter 0.98
JSON_Fast_Hash_Helm_Chart_Lock 68.84132391187364 ns/iter 68.83588568649263 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 148.40433524727015 ns/iter 149.54224050901766 ns/iter 0.99
JSON_String_Equal/10 6.345209618491003 ns/iter 6.345388239459724 ns/iter 1.00
JSON_String_Equal/100 6.96805955838001 ns/iter 7.01363113078847 ns/iter 0.99
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9340058812681229 ns/iter 0.9347266704606404 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.29039927365104 ns/iter 14.292050205515787 ns/iter 1.00
JSON_String_Fast_Hash/10 0.9333104058134465 ns/iter 0.9350701900004398 ns/iter 1.00
JSON_String_Fast_Hash/100 0.9366630372847058 ns/iter 0.937087401162159 ns/iter 1.00
JSON_String_Key_Hash/10 1.672494893052129 ns/iter 1.671596716626417 ns/iter 1.00
JSON_String_Key_Hash/100 1.9835047622234228 ns/iter 2.0421013904697034 ns/iter 0.97
JSON_Object_Defines_Miss_Same_Length 2.486653070995715 ns/iter 2.493658442781414 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 2.487879580389224 ns/iter 2.490102170819413 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.108209434359394 ns/iter 3.108175935748401 ns/iter 1.00
Regex_Lower_S_Or_Upper_S_Asterisk 3.4220122644218325 ns/iter 3.4182006829022353 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 3.42571503879976 ns/iter 3.419306177994497 ns/iter 1.00
Regex_Period_Asterisk 3.4226284476093505 ns/iter 3.4243828349055567 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 3.431436004894953 ns/iter 3.435013680213748 ns/iter 1.00
Regex_Period_Plus 3.7356062995099713 ns/iter 3.7349874050308993 ns/iter 1.00
Regex_Period 3.7305051560455933 ns/iter 3.7315567909304734 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 3.730906522849481 ns/iter 3.737034539386885 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 3.736463164532029 ns/iter 3.742940083824722 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 4.661521669738229 ns/iter 3.4292197649776157 ns/iter 1.36
Regex_Caret_Group_Period_Asterisk_Group_Dollar 4.662213633709324 ns/iter 3.423995798986543 ns/iter 1.36
Regex_Caret_X_Hyphen 12.438045613415216 ns/iter 13.119482776908558 ns/iter 0.95
Regex_Period_Md_Dollar 96.21829999164899 ns/iter 89.7816024050595 ns/iter 1.07
Regex_Caret_Slash_Period_Asterisk 8.15712348895412 ns/iter 7.148802349926032 ns/iter 1.14
Regex_Caret_Period_Range_Dollar 4.674779254270041 ns/iter 4.665792559533156 ns/iter 1.00
Regex_Nested_Backtrack 820.4556609798245 ns/iter 817.8560000000089 ns/iter 1.00

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

@jviotti jviotti force-pushed the for-each-reference branch from ecaef83 to 8ff60cf Compare January 29, 2025 19:34
@jviotti jviotti merged commit 8cf5a49 into main Jan 29, 2025
13 checks passed
@jviotti jviotti deleted the for-each-reference branch January 29, 2025 19:48
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