-
-
Notifications
You must be signed in to change notification settings - Fork 5
Add the first 31 bytes to the hash of long strings #1581
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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: e3c528f | Previous: ef23a63 | Ratio |
---|---|---|---|
Regex_Lower_S_Or_Upper_S_Asterisk |
2.194608708142537 ns/iter |
2.2741040765195484 ns/iter |
0.97 |
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar |
2.1891728974237736 ns/iter |
2.197227537375164 ns/iter |
1.00 |
Regex_Period_Asterisk |
2.197784730476227 ns/iter |
2.2021653333314717 ns/iter |
1.00 |
Regex_Group_Period_Asterisk_Group |
2.201905358997954 ns/iter |
2.2064004920125 ns/iter |
1.00 |
Regex_Period_Plus |
2.4861245388109108 ns/iter |
2.4892319206740448 ns/iter |
1.00 |
Regex_Period |
2.2136555605675285 ns/iter |
2.487386067465957 ns/iter |
0.89 |
Regex_Caret_Period_Plus_Dollar |
2.215920669197784 ns/iter |
2.3005473977927573 ns/iter |
0.96 |
Regex_Caret_Group_Period_Plus_Group_Dollar |
2.2093786867771086 ns/iter |
2.261466165325176 ns/iter |
0.98 |
Regex_Caret_Period_Asterisk_Dollar |
2.4877466891651485 ns/iter |
2.192210812289226 ns/iter |
1.13 |
Regex_Caret_Group_Period_Asterisk_Group_Dollar |
2.4873274789178916 ns/iter |
2.213176406402446 ns/iter |
1.12 |
Regex_Caret_X_Hyphen |
13.05471967975648 ns/iter |
13.054634084526258 ns/iter |
1.00 |
Regex_Period_Md_Dollar |
74.62164462346756 ns/iter |
73.24602478544607 ns/iter |
1.02 |
Regex_Caret_Slash_Period_Asterisk |
6.219619316143807 ns/iter |
5.917348802563143 ns/iter |
1.05 |
Regex_Caret_Period_Range_Dollar |
4.0402368319828925 ns/iter |
2.7986822713767627 ns/iter |
1.44 |
Regex_Nested_Backtrack |
454.62696141731453 ns/iter |
455.25213599906084 ns/iter |
1.00 |
JSON_Array_Of_Objects_Unique |
392.8849866346052 ns/iter |
394.9011088188166 ns/iter |
0.99 |
JSON_Parse_1 |
29427.196548540123 ns/iter |
28875.320473422886 ns/iter |
1.02 |
JSON_Fast_Hash_Helm_Chart_Lock |
59.23331727191362 ns/iter |
59.383255689030726 ns/iter |
1.00 |
JSON_Equality_Helm_Chart_Lock |
164.17339101179638 ns/iter |
147.62896835309635 ns/iter |
1.11 |
JSON_String_Equal/10 |
6.533188529587054 ns/iter |
6.224406593496116 ns/iter |
1.05 |
JSON_String_Equal/100 |
7.182617640967761 ns/iter |
6.84325180151978 ns/iter |
1.05 |
JSON_String_Equal_Small_By_Perfect_Hash/10 |
0.9355333710795862 ns/iter |
0.935490121842896 ns/iter |
1.00 |
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 |
10.258173176716793 ns/iter |
14.622881911997116 ns/iter |
0.70 |
JSON_String_Fast_Hash/10 |
2.175955030666455 ns/iter |
2.173950390262346 ns/iter |
1.00 |
JSON_String_Fast_Hash/100 |
2.1754266629111974 ns/iter |
2.1755904109409907 ns/iter |
1.00 |
JSON_String_Key_Hash/10 |
2.17846958397891 ns/iter |
2.7112471345230107 ns/iter |
0.80 |
JSON_String_Key_Hash/100 |
6.526876484046186 ns/iter |
2.8004870683258734 ns/iter |
2.33 |
JSON_Object_Defines_Miss_Same_Length |
3.7327211261285798 ns/iter |
3.7401673330721024 ns/iter |
1.00 |
JSON_Object_Defines_Miss_Too_Small |
3.7320967621913743 ns/iter |
3.7340356395017005 ns/iter |
1.00 |
JSON_Object_Defines_Miss_Too_Large |
3.746971103955344 ns/iter |
3.732589357501147 ns/iter |
1.00 |
Pointer_Object_Traverse |
44.38368201092434 ns/iter |
44.36025793762536 ns/iter |
1.00 |
Pointer_Object_Try_Traverse |
52.27243651139533 ns/iter |
52.29730546464622 ns/iter |
1.00 |
Pointer_Push_Back_Pointer_To_Weak_Pointer |
309.318076576972 ns/iter |
308.4439369629659 ns/iter |
1.00 |
Schema_Frame_OMC_Instances |
187354834.6666591 ns/iter |
179812651.9999954 ns/iter |
1.04 |
Schema_Frame_OMC_References |
102597812.85714099 ns/iter |
98315824.714291 ns/iter |
1.04 |
Schema_Frame_OMC_Locations |
96859662.14285763 ns/iter |
94297180.85713796 ns/iter |
1.03 |
Schema_Bundle_Meta_2020_12 |
6339329.3394522 ns/iter |
6355233.972225047 ns/iter |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this 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: e3c528f | Previous: ef23a63 | Ratio |
---|---|---|---|
Regex_Lower_S_Or_Upper_S_Asterisk |
1.6341854919281615 ns/iter |
1.5687589700154938 ns/iter |
1.04 |
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar |
1.635556318310614 ns/iter |
1.572388738891492 ns/iter |
1.04 |
Regex_Period_Asterisk |
1.6343814716205385 ns/iter |
1.566428464999198 ns/iter |
1.04 |
Regex_Group_Period_Asterisk_Group |
1.6316609356060932 ns/iter |
1.5999591723928372 ns/iter |
1.02 |
Regex_Period_Plus |
2.0318710248474194 ns/iter |
1.8813481950825055 ns/iter |
1.08 |
Regex_Period |
1.962943498520278 ns/iter |
1.8867964307534426 ns/iter |
1.04 |
Regex_Caret_Period_Plus_Dollar |
1.9621261996136263 ns/iter |
1.8795712695539657 ns/iter |
1.04 |
Regex_Caret_Group_Period_Plus_Group_Dollar |
1.955854934865505 ns/iter |
1.8857035897662904 ns/iter |
1.04 |
Regex_Caret_Period_Asterisk_Dollar |
1.6220280296920997 ns/iter |
1.5670892634536704 ns/iter |
1.04 |
Regex_Caret_Group_Period_Asterisk_Group_Dollar |
1.6283885754693588 ns/iter |
1.5672252268012383 ns/iter |
1.04 |
Regex_Caret_X_Hyphen |
6.598102434915337 ns/iter |
6.575704908320861 ns/iter |
1.00 |
Regex_Period_Md_Dollar |
69.97291846824174 ns/iter |
67.63475061930819 ns/iter |
1.03 |
Regex_Caret_Slash_Period_Asterisk |
5.887384985401741 ns/iter |
5.194287656975412 ns/iter |
1.13 |
Regex_Caret_Period_Range_Dollar |
2.106454443867368 ns/iter |
2.1973285781309473 ns/iter |
0.96 |
Regex_Nested_Backtrack |
756.2164653766238 ns/iter |
725.0447250823806 ns/iter |
1.04 |
JSON_Array_Of_Objects_Unique |
350.3678129769421 ns/iter |
334.9713171314023 ns/iter |
1.05 |
JSON_Parse_1 |
20372.137487661555 ns/iter |
19730.95068122883 ns/iter |
1.03 |
JSON_Fast_Hash_Helm_Chart_Lock |
50.01090004024897 ns/iter |
47.7581082182337 ns/iter |
1.05 |
JSON_Equality_Helm_Chart_Lock |
119.3829067754113 ns/iter |
115.9428621340102 ns/iter |
1.03 |
JSON_String_Equal/10 |
7.971036203995862 ns/iter |
7.526485380616838 ns/iter |
1.06 |
JSON_String_Equal/100 |
6.470092044412599 ns/iter |
6.033557011553221 ns/iter |
1.07 |
JSON_String_Equal_Small_By_Perfect_Hash/10 |
0.3456026524896405 ns/iter |
0.3133607709953241 ns/iter |
1.10 |
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 |
3.1653235516769076 ns/iter |
2.9012848198269627 ns/iter |
1.09 |
JSON_String_Fast_Hash/10 |
1.7514414981742543 ns/iter |
1.566777864845094 ns/iter |
1.12 |
JSON_String_Fast_Hash/100 |
2.2668987492425923 ns/iter |
1.9013242200934308 ns/iter |
1.19 |
JSON_String_Key_Hash/10 |
1.383869112028278 ns/iter |
1.2684826728689211 ns/iter |
1.09 |
JSON_String_Key_Hash/100 |
2.1748958713647433 ns/iter |
1.6748356092543089 ns/iter |
1.30 |
JSON_Object_Defines_Miss_Same_Length |
2.60371456063086 ns/iter |
2.197849504526521 ns/iter |
1.18 |
JSON_Object_Defines_Miss_Too_Small |
2.602300157211554 ns/iter |
2.201533154870615 ns/iter |
1.18 |
JSON_Object_Defines_Miss_Too_Large |
2.622238536738856 ns/iter |
2.1922124878792086 ns/iter |
1.20 |
Pointer_Object_Traverse |
17.325701204649356 ns/iter |
16.338560172323863 ns/iter |
1.06 |
Pointer_Object_Try_Traverse |
20.786658837608474 ns/iter |
21.764941420257085 ns/iter |
0.96 |
Pointer_Push_Back_Pointer_To_Weak_Pointer |
177.93916445710653 ns/iter |
174.00754564233242 ns/iter |
1.02 |
Schema_Frame_OMC_Instances |
164482716.800012 ns/iter |
141157441.60001212 ns/iter |
1.17 |
Schema_Frame_OMC_References |
92336921.87498832 ns/iter |
77451689.88887802 ns/iter |
1.19 |
Schema_Frame_OMC_Locations |
88704156.25000305 ns/iter |
74296588.00000046 ns/iter |
1.19 |
Schema_Bundle_Meta_2020_12 |
5018116.531468527 ns/iter |
4477513.2356635025 ns/iter |
1.12 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this 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: e3c528f | Previous: ef23a63 | Ratio |
---|---|---|---|
Regex_Lower_S_Or_Upper_S_Asterisk |
2.489805357142976 ns/iter |
2.491289285714109 ns/iter |
1.00 |
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar |
3.0993372503135284 ns/iter |
3.1097321428568137 ns/iter |
1.00 |
Regex_Period_Asterisk |
2.7870938826842084 ns/iter |
2.8000575632144225 ns/iter |
1.00 |
Regex_Group_Period_Asterisk_Group |
2.4770510714282477 ns/iter |
2.4775821428570617 ns/iter |
1.00 |
Regex_Period_Plus |
2.788899507684234 ns/iter |
2.8078662041035916 ns/iter |
0.99 |
Regex_Period |
2.792145132682173 ns/iter |
2.794341695181082 ns/iter |
1.00 |
Regex_Caret_Period_Plus_Dollar |
2.832122811235312 ns/iter |
2.794245668395516 ns/iter |
1.01 |
Regex_Caret_Group_Period_Plus_Group_Dollar |
2.7897557130405226 ns/iter |
2.8062195957085208 ns/iter |
0.99 |
Regex_Caret_Period_Asterisk_Dollar |
2.7936666951817175 ns/iter |
2.7873397755412603 ns/iter |
1.00 |
Regex_Caret_Group_Period_Asterisk_Group_Dollar |
2.4806799999997304 ns/iter |
2.483556428571124 ns/iter |
1.00 |
Regex_Caret_X_Hyphen |
5.884648214287073 ns/iter |
5.925024999999096 ns/iter |
0.99 |
Regex_Period_Md_Dollar |
148.7682812500018 ns/iter |
147.73332589287847 ns/iter |
1.01 |
Regex_Caret_Slash_Period_Asterisk |
5.921583928570483 ns/iter |
5.876323999999612 ns/iter |
1.01 |
Regex_Caret_Period_Range_Dollar |
3.099304910713434 ns/iter |
3.101928754846535 ns/iter |
1.00 |
Regex_Nested_Backtrack |
577.6028571428275 ns/iter |
577.7537500000968 ns/iter |
1.00 |
JSON_Array_Of_Objects_Unique |
497.2157000001971 ns/iter |
415.35230288606385 ns/iter |
1.20 |
JSON_Parse_1 |
75738.97321430576 ns/iter |
75069.56249999673 ns/iter |
1.01 |
JSON_Fast_Hash_Helm_Chart_Lock |
68.96117857144597 ns/iter |
59.21368749999902 ns/iter |
1.16 |
JSON_Equality_Helm_Chart_Lock |
205.1326783423026 ns/iter |
195.6452613551137 ns/iter |
1.05 |
JSON_String_Equal/10 |
8.962813352844107 ns/iter |
9.361620493920707 ns/iter |
0.96 |
JSON_String_Equal/100 |
10.532208435123795 ns/iter |
10.64599999999949 ns/iter |
0.99 |
JSON_String_Equal_Small_By_Perfect_Hash/10 |
2.169743750000208 ns/iter |
2.251046071428472 ns/iter |
0.96 |
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 |
12.463566071427781 ns/iter |
14.582878729541266 ns/iter |
0.85 |
JSON_String_Fast_Hash/10 |
3.7110161102735137 ns/iter |
3.232713839285647 ns/iter |
1.15 |
JSON_String_Fast_Hash/100 |
3.716598207648851 ns/iter |
3.1022790178571062 ns/iter |
1.20 |
JSON_String_Key_Hash/10 |
3.713528564797022 ns/iter |
7.57005130549063 ns/iter |
0.49 |
JSON_String_Key_Hash/100 |
16.115375561725177 ns/iter |
4.341112499999866 ns/iter |
3.71 |
JSON_Object_Defines_Miss_Same_Length |
4.643506528776498 ns/iter |
4.73172188556214 ns/iter |
0.98 |
JSON_Object_Defines_Miss_Too_Small |
3.7127774933708353 ns/iter |
3.7150971362228518 ns/iter |
1.00 |
JSON_Object_Defines_Miss_Too_Large |
4.638913783252985 ns/iter |
4.651895167149877 ns/iter |
1.00 |
Pointer_Object_Traverse |
52.34298214284243 ns/iter |
50.73031000000583 ns/iter |
1.03 |
Pointer_Object_Try_Traverse |
68.54365178572915 ns/iter |
66.9837857142852 ns/iter |
1.02 |
Pointer_Push_Back_Pointer_To_Weak_Pointer |
178.69809631235032 ns/iter |
201.85966732771777 ns/iter |
0.89 |
Schema_Frame_OMC_Instances |
383815949.9999847 ns/iter |
392121849.9999668 ns/iter |
0.98 |
Schema_Frame_OMC_References |
231832233.33330715 ns/iter |
243452733.33335626 ns/iter |
0.95 |
Schema_Frame_OMC_Locations |
220484366.66659653 ns/iter |
228836566.6666626 ns/iter |
0.96 |
Schema_Bundle_Meta_2020_12 |
14825483.99997995 ns/iter |
14848068.000003424 ns/iter |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
d04dbbf
to
e9b7de0
Compare
Note that hashing long strings is significantly slower. This is expected, but I don't think it's a problem. We're sacrificing a bit more time to hash the strings to avoid collisions in the future. Since collisions always mean a string comparison of longer strings, I think this will be a significant win overall. We may want another microbenchmark to capture this. |
There was a problem hiding this 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: e3c528f | Previous: ef23a63 | Ratio |
---|---|---|---|
Schema_Frame_OMC_Instances |
180599960.9999844 ns/iter |
181297601.75000343 ns/iter |
1.00 |
Schema_Frame_OMC_References |
102860815.42856859 ns/iter |
102829561.00000514 ns/iter |
1.00 |
Schema_Frame_OMC_Locations |
98629833.57144068 ns/iter |
98241569.71428367 ns/iter |
1.00 |
Schema_Bundle_Meta_2020_12 |
6374422.146789317 ns/iter |
6398184.431191112 ns/iter |
1.00 |
Pointer_Object_Traverse |
50.143802487708584 ns/iter |
53.40902950788947 ns/iter |
0.94 |
Pointer_Object_Try_Traverse |
23.014722832910767 ns/iter |
23.41729322981829 ns/iter |
0.98 |
Pointer_Push_Back_Pointer_To_Weak_Pointer |
162.0009696563512 ns/iter |
157.82653134351958 ns/iter |
1.03 |
JSON_Array_Of_Objects_Unique |
387.8127883264216 ns/iter |
386.08052222808055 ns/iter |
1.00 |
JSON_Parse_1 |
31129.73810792051 ns/iter |
31524.824583524947 ns/iter |
0.99 |
JSON_Fast_Hash_Helm_Chart_Lock |
69.00176440869903 ns/iter |
63.64611925630432 ns/iter |
1.08 |
JSON_Equality_Helm_Chart_Lock |
154.65185736128228 ns/iter |
159.45571861677476 ns/iter |
0.97 |
JSON_String_Equal/10 |
6.653414077921237 ns/iter |
6.341209094911496 ns/iter |
1.05 |
JSON_String_Equal/100 |
7.279014730420019 ns/iter |
6.9854946650527445 ns/iter |
1.04 |
JSON_String_Equal_Small_By_Perfect_Hash/10 |
0.6236825488579819 ns/iter |
0.9341342888660307 ns/iter |
0.67 |
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 |
25.779815100802914 ns/iter |
19.42998570944464 ns/iter |
1.33 |
JSON_String_Fast_Hash/10 |
0.9331547232113957 ns/iter |
0.9333349310236535 ns/iter |
1.00 |
JSON_String_Fast_Hash/100 |
0.9334467303055772 ns/iter |
0.9332399359461006 ns/iter |
1.00 |
JSON_String_Key_Hash/10 |
1.557507833978225 ns/iter |
1.2450392903030962 ns/iter |
1.25 |
JSON_String_Key_Hash/100 |
12.428363223611642 ns/iter |
2.0254122925440265 ns/iter |
6.14 |
JSON_Object_Defines_Miss_Same_Length |
2.7987347303518764 ns/iter |
2.7996033741812454 ns/iter |
1.00 |
JSON_Object_Defines_Miss_Too_Small |
2.488021620608897 ns/iter |
2.487636102651229 ns/iter |
1.00 |
JSON_Object_Defines_Miss_Too_Large |
2.798629223417492 ns/iter |
2.4883006057405908 ns/iter |
1.12 |
Regex_Lower_S_Or_Upper_S_Asterisk |
3.1094648758768315 ns/iter |
3.108210293273058 ns/iter |
1.00 |
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar |
3.1091967211229288 ns/iter |
2.7976859665104947 ns/iter |
1.11 |
Regex_Period_Asterisk |
3.109782811560824 ns/iter |
2.799169761895301 ns/iter |
1.11 |
Regex_Group_Period_Asterisk_Group |
3.1099991746195856 ns/iter |
2.797734034778045 ns/iter |
1.11 |
Regex_Period_Plus |
3.419958775315915 ns/iter |
2.7974263434027846 ns/iter |
1.22 |
Regex_Period |
3.41977636034969 ns/iter |
2.797820135370499 ns/iter |
1.22 |
Regex_Caret_Period_Plus_Dollar |
3.4187094177285595 ns/iter |
2.8033051748598736 ns/iter |
1.22 |
Regex_Caret_Group_Period_Plus_Group_Dollar |
3.426690975473469 ns/iter |
3.1118169445188344 ns/iter |
1.10 |
Regex_Caret_Period_Asterisk_Dollar |
4.350915952027343 ns/iter |
3.734154569384502 ns/iter |
1.17 |
Regex_Caret_Group_Period_Asterisk_Group_Dollar |
4.371997849998495 ns/iter |
3.7212867779038374 ns/iter |
1.17 |
Regex_Caret_X_Hyphen |
13.677041420381086 ns/iter |
13.1271398095828 ns/iter |
1.04 |
Regex_Period_Md_Dollar |
89.11810211626013 ns/iter |
89.2785553310974 ns/iter |
1.00 |
Regex_Caret_Slash_Period_Asterisk |
9.638803493697363 ns/iter |
8.082091389024054 ns/iter |
1.19 |
Regex_Caret_Period_Range_Dollar |
4.35460280790685 ns/iter |
4.039011469886 ns/iter |
1.08 |
Regex_Nested_Backtrack |
822.4376919287142 ns/iter |
826.0010917055691 ns/iter |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this 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: e3c528f | Previous: ef23a63 | Ratio |
---|---|---|---|
Regex_Lower_S_Or_Upper_S_Asterisk |
2.270027788397034 ns/iter |
2.067240437805002 ns/iter |
1.10 |
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar |
2.186399560706396 ns/iter |
2.0654736430199456 ns/iter |
1.06 |
Regex_Period_Asterisk |
1.9940237744719587 ns/iter |
2.1637651698608873 ns/iter |
0.92 |
Regex_Group_Period_Asterisk_Group |
2.0382599834760335 ns/iter |
2.083235800529215 ns/iter |
0.98 |
Regex_Period_Plus |
1.695248931844643 ns/iter |
1.7305340822614512 ns/iter |
0.98 |
Regex_Period |
1.6516595076958007 ns/iter |
1.6968801417833623 ns/iter |
0.97 |
Regex_Caret_Period_Plus_Dollar |
1.6387683066167555 ns/iter |
1.730573801341907 ns/iter |
0.95 |
Regex_Caret_Group_Period_Plus_Group_Dollar |
1.6464483021897798 ns/iter |
1.8946469907014307 ns/iter |
0.87 |
Regex_Caret_Period_Asterisk_Dollar |
1.9456980634231782 ns/iter |
2.38015202671499 ns/iter |
0.82 |
Regex_Caret_Group_Period_Asterisk_Group_Dollar |
2.078815547426529 ns/iter |
2.0181331839031103 ns/iter |
1.03 |
Regex_Caret_X_Hyphen |
6.6213506290479085 ns/iter |
6.453095658096664 ns/iter |
1.03 |
Regex_Period_Md_Dollar |
75.76765172473709 ns/iter |
70.9855463166676 ns/iter |
1.07 |
Regex_Caret_Slash_Period_Asterisk |
4.839215316841383 ns/iter |
4.79247637714299 ns/iter |
1.01 |
Regex_Caret_Period_Range_Dollar |
2.0210330275616184 ns/iter |
2.0179011630624966 ns/iter |
1.00 |
Regex_Nested_Backtrack |
860.8363750841185 ns/iter |
843.4051420685827 ns/iter |
1.02 |
JSON_Array_Of_Objects_Unique |
221.17549852655014 ns/iter |
226.52452872953043 ns/iter |
0.98 |
JSON_Parse_1 |
23280.83283298839 ns/iter |
22540.901834102 ns/iter |
1.03 |
JSON_Fast_Hash_Helm_Chart_Lock |
27.6664139631074 ns/iter |
25.746315313462578 ns/iter |
1.07 |
JSON_Equality_Helm_Chart_Lock |
134.65319913644382 ns/iter |
122.16940834312555 ns/iter |
1.10 |
JSON_String_Equal/10 |
6.0078555616577205 ns/iter |
5.841004907532741 ns/iter |
1.03 |
JSON_String_Equal/100 |
6.099802314641609 ns/iter |
6.109332732497189 ns/iter |
1.00 |
JSON_String_Equal_Small_By_Perfect_Hash/10 |
0.8161215177377179 ns/iter |
0.8135148552209757 ns/iter |
1.00 |
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 |
3.7560386607003524 ns/iter |
3.8502044464067797 ns/iter |
0.98 |
JSON_String_Fast_Hash/10 |
2.0636729315273197 ns/iter |
2.116872704583969 ns/iter |
0.97 |
JSON_String_Fast_Hash/100 |
2.0369154716954947 ns/iter |
2.1174604396009093 ns/iter |
0.96 |
JSON_String_Key_Hash/10 |
1.5560552958344112 ns/iter |
1.5788126758064798 ns/iter |
0.99 |
JSON_String_Key_Hash/100 |
2.627025070037832 ns/iter |
2.8735871824334795 ns/iter |
0.91 |
JSON_Object_Defines_Miss_Same_Length |
1.9239540508407187 ns/iter |
1.865213692813078 ns/iter |
1.03 |
JSON_Object_Defines_Miss_Too_Small |
1.9109889179816952 ns/iter |
2.058397987319809 ns/iter |
0.93 |
JSON_Object_Defines_Miss_Too_Large |
1.9206022991702765 ns/iter |
1.8657155143032071 ns/iter |
1.03 |
Pointer_Object_Traverse |
55.78456296376594 ns/iter |
54.81882857290427 ns/iter |
1.02 |
Pointer_Object_Try_Traverse |
38.25703202076386 ns/iter |
38.162233181773935 ns/iter |
1.00 |
Pointer_Push_Back_Pointer_To_Weak_Pointer |
165.37116373934884 ns/iter |
170.27020949407276 ns/iter |
0.97 |
Schema_Frame_OMC_Instances |
161075770.85494995 ns/iter |
170454561.71035767 ns/iter |
0.94 |
Schema_Frame_OMC_References |
87755382.06100464 ns/iter |
111652016.63970947 ns/iter |
0.79 |
Schema_Frame_OMC_Locations |
92838525.77209473 ns/iter |
115518297.46791294 ns/iter |
0.80 |
Schema_Bundle_Meta_2020_12 |
5200871.5228758 ns/iter |
5589140.786064995 ns/iter |
0.93 |
This comment was automatically generated by workflow using github-action-benchmark.
Let me open a Blaze PR with this so we can see the GoogleBenchmark impact and also on the final benchmark |
Making this a draft for now so we don't accidentally merge! |
Closing this as I think we confirmed that there was not much of a boost after all. We can revisit if needed |
I think it could still be worthwhile since it should only add a tiny amount of overhead. There was one test case that had long strings that I think benefited here. |
OK, let me re-open, rebase, and we test once more to confirm? |
We are getting some conflicts though. Would you want to fix them, given you created this PR? |
Signed-off-by: Michael Mior <[email protected]>
e9b7de0
to
e3c528f
Compare
@jviotti Take a look as I think this should be fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Do you want me to open a branch to test this in Blaze first or are we fine with merging? I think we did run the benchmark with this change and it was good, right?
This adds the first 31 bytes of the string into the hash value when we are dealing with longer strings.
This should serve to reduce hash collisions and consequently, also eliminate some string comparisons.