Commit 6d48411
committed
#57: Optimize pointer hashing in async waker events
- Add ptr_to_index() function to improve hash distribution for pointer keys
- Replace all (zend_ulong) event casts with ptr_to_index(event) calls
- Use zend_hash_index_find_ptr() where appropriate to simplify code
- Preserve critical memory management in waker trigger updates
The ptr_to_index() function uses right rotation by 3 bits to better
distribute pointer addresses as hash keys, reducing collisions caused
by zero lower bits from memory alignment.1 parent 875eadb commit 6d48411
4 files changed
+29
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
247 | 247 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | 248 | | |
252 | 249 | | |
253 | 250 | | |
254 | 251 | | |
255 | 252 | | |
256 | 253 | | |
257 | 254 | | |
| 255 | + | |
258 | 256 | | |
259 | 257 | | |
260 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
910 | 910 | | |
911 | 911 | | |
912 | 912 | | |
913 | | - | |
| 913 | + | |
914 | 914 | | |
915 | 915 | | |
916 | 916 | | |
| |||
927 | 927 | | |
928 | 928 | | |
929 | 929 | | |
930 | | - | |
| 930 | + | |
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
| |||
989 | 989 | | |
990 | 990 | | |
991 | 991 | | |
992 | | - | |
| 992 | + | |
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
| |||
1057 | 1057 | | |
1058 | 1058 | | |
1059 | 1059 | | |
1060 | | - | |
| 1060 | + | |
1061 | 1061 | | |
1062 | 1062 | | |
1063 | 1063 | | |
| |||
1069 | 1069 | | |
1070 | 1070 | | |
1071 | 1071 | | |
1072 | | - | |
| 1072 | + | |
1073 | 1073 | | |
1074 | 1074 | | |
1075 | 1075 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
687 | 687 | | |
688 | 688 | | |
689 | 689 | | |
690 | | - | |
| 690 | + | |
691 | 691 | | |
692 | | - | |
| 692 | + | |
693 | 693 | | |
694 | | - | |
695 | 694 | | |
696 | 695 | | |
697 | 696 | | |
| |||
714 | 713 | | |
715 | 714 | | |
716 | 715 | | |
717 | | - | |
718 | | - | |
| 716 | + | |
| 717 | + | |
719 | 718 | | |
720 | | - | |
721 | 719 | | |
722 | 720 | | |
723 | 721 | | |
| |||
727 | 725 | | |
728 | 726 | | |
729 | 727 | | |
730 | | - | |
731 | | - | |
| 728 | + | |
| 729 | + | |
732 | 730 | | |
733 | | - | |
734 | 731 | | |
735 | 732 | | |
736 | 733 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
270 | 285 | | |
0 commit comments