Repository navigation
Commit 6caf474
committed
Widen the join of conditional expression holders with the same guards
mergeSameGuardConditionalExpressions() joined the types of conditional
holders across branches with the exact union() only. Since union() no
longer generalizes big constant arrays itself, these joins grew without
bound: a loop bumping counters of a 15-key shape in if/elseif chains
inside a switch held about 70 shapes per holder and took 57 s. The join
is now widened like the joins of scopes in ExpressionTypeHolder::and().
Closes phpstan/phpstan#15862
Amp-Thread-ID: https://ampcode.com/threads/T-01a21c4b-0cd2-7583-a39a-cf304ee8e07b1 parent b50f182 commit 6caf474
3 files changed
Lines changed: 96 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4731 | 4731 | | |
4732 | 4732 | | |
4733 | 4733 | | |
4734 | | - | |
| 4734 | + | |
4735 | 4735 | | |
4736 | 4736 | | |
4737 | 4737 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8961 | 8961 | | |
8962 | 8962 | | |
8963 | 8963 | | |
8964 | | - | |
| 8964 | + | |
| 8965 | + | |
| 8966 | + | |
| 8967 | + | |
8965 | 8968 | | |
8966 | 8969 | | |
8967 | 8970 | | |
| |||
0 commit comments