Commit 6c7c5de
Cache version-resilient hash code on MethodTableAuxiliaryData to fix superlinear behavior with polymorphic recursion (#126534)
`GetVersionResilientTypeHashCode` recomputes hash codes recursively
without memoization. With polymorphic recursion, each level doubles the
number of unique generic instantiations, causing exponential blowup —
`n=31` took ~15s before this fix.
On 64-bit release builds, `MethodTableAuxiliaryData` already had 4 bytes
of implicit alignment padding between the union and `m_pLoaderModule`.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: davidwrighton <10779849+davidwrighton@users.noreply.github.com>
Co-authored-by: David Wrighton <davidwr@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>1 parent 797626d commit 6c7c5de
3 files changed
Lines changed: 39 additions & 19 deletions
File tree
- src/coreclr
- System.Private.CoreLib/src/System/Runtime/CompilerServices
- vm
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1125 | 1125 | | |
1126 | 1126 | | |
1127 | 1127 | | |
| 1128 | + | |
1128 | 1129 | | |
1129 | 1130 | | |
1130 | 1131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
354 | 359 | | |
355 | 360 | | |
356 | 361 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | 113 | | |
119 | 114 | | |
120 | 115 | | |
121 | 116 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 117 | + | |
129 | 118 | | |
130 | | - | |
131 | | - | |
| 119 | + | |
| 120 | + | |
132 | 121 | | |
133 | | - | |
| 122 | + | |
134 | 123 | | |
135 | 124 | | |
136 | | - | |
| 125 | + | |
| 126 | + | |
137 | 127 | | |
138 | | - | |
139 | | - | |
| 128 | + | |
140 | 129 | | |
141 | 130 | | |
142 | 131 | | |
143 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
144 | 156 | | |
| 157 | + | |
| 158 | + | |
145 | 159 | | |
146 | 160 | | |
147 | 161 | | |
| |||
0 commit comments