Repository navigation
Commit 70d5b9d
Resolve constant offsets on constant arrays through the key index
ConstantArrayType::isSuperTypeOf() asks the other array about every key
with hasOffsetValueType() and getOffsetValueType(), and both scanned the
whole key list with isSuperTypeOf() per key, so comparing two array shapes
was quadratic in their size. The scope's conditional-expression matching
compares the shape of a variable against every recorded condition on it,
which made a method with dozens of `$params['key'] ?? null` reads over a
large optional array shape spend seconds in ConstantStringType::isSuperTypeOf.
Constant integer and string offsets now resolve through the existing
value-keyed index: a hit is verified with isSuperTypeOf() before it is used,
a miss keeps the full scan, and isOptionalKey() reads a set instead of
in_array() over the optional keys.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GvDxWpzXzticTTm5eLCsb21 parent 5071596 commit 70d5b9d
1 file changed
Lines changed: 57 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
132 | 136 | | |
133 | 137 | | |
134 | 138 | | |
| |||
480 | 484 | | |
481 | 485 | | |
482 | 486 | | |
483 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
484 | 490 | | |
485 | 491 | | |
486 | 492 | | |
| |||
1186 | 1192 | | |
1187 | 1193 | | |
1188 | 1194 | | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
1189 | 1206 | | |
1190 | 1207 | | |
1191 | 1208 | | |
| |||
1240 | 1257 | | |
1241 | 1258 | | |
1242 | 1259 | | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
1243 | 1275 | | |
1244 | 1276 | | |
1245 | 1277 | | |
| |||
3161 | 3193 | | |
3162 | 3194 | | |
3163 | 3195 | | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
| 3213 | + | |
| 3214 | + | |
| 3215 | + | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
| 3219 | + | |
3164 | 3220 | | |
3165 | 3221 | | |
3166 | 3222 | | |
| |||
0 commit comments