Commit 3a2831e
committed
Optimize canDropAlias
Cache canDopAlias calls in TypeRefs.
Performance tests pointed to a ~1% showdown before, which is really in the noise.
However, stats showed that the number of iterations in the exists call of
`canDropAlias` is significant (a bit more than total member operations).
With this optimization, the number of calls gets reduced to 1% of what it was.1 parent e2399f1 commit 3a2831e
File tree
2 files changed
+29
-24
lines changed- compiler/src/dotty/tools/dotc/core
2 files changed
+29
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | 234 | | |
257 | 235 | | |
258 | 236 | | |
| |||
261 | 239 | | |
262 | 240 | | |
263 | 241 | | |
264 | | - | |
| 242 | + | |
265 | 243 | | |
266 | 244 | | |
267 | 245 | | |
268 | 246 | | |
269 | 247 | | |
270 | 248 | | |
271 | | - | |
| 249 | + | |
272 | 250 | | |
273 | 251 | | |
274 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2403 | 2403 | | |
2404 | 2404 | | |
2405 | 2405 | | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
2406 | 2433 | | |
2407 | 2434 | | |
2408 | 2435 | | |
| |||
0 commit comments