Commit 8510baf
committed
Avoid unnecessary under-constrained implicit searches
In some situations we only call `constrainResult` for its side-effects
and ignore its result, but `constrainResult` calls
`necessarilyCompatible` which will call `viewExists` as a last-try.
Since `viewExists` doesn't have side-effects we might as well skip it,
and it turns out that using `NoViewsAllowed.constrainResult` does
exactly that.
This leads to a significant speed-up (from ~8s to sub-second with a hot
compiler) with the test case from #14333 (most likely this is because at
the point where we call `constrainResult` we haven't accumulated any
constraint from the arguments of the application, so implicit search is
free to go on a wild goose chase).
I also removed obsolete comments in this method.
Fixes #14333.1 parent 0e4e5d5 commit 8510baf
1 file changed
+11
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
437 | 436 | | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
445 | 448 | | |
446 | 449 | | |
447 | 450 | | |
| |||
0 commit comments