Faster ConstantArrayType->isSuperTypeOf()#2086
Conversation
ecec0ac to
a519fa3
Compare
|
|
||
| $isValueSuperType = $this->valueTypes[$i]->isSuperTypeOf($type->getOffsetValueType($keyType)); | ||
| if ($isValueSuperType->no()) { | ||
| return TrinaryLogic::createNo(); |
There was a problem hiding this comment.
| return TrinaryLogic::createNo(); | |
| return $isValueSuperType; |
should be possible, no? or any other reason why you didn't do that?
There was a problem hiding this comment.
createNo is cheap and I like seeing on the first sight without applying any logics what the return type is.
but its the same thing, you are right.
|
Thank you! |
|
@ondrejmirtes we could apply a similar early return NO on NO here: I have no concrete perf relevant case to measure it. wdyt? |
|
Only if it shows up in Blackfire :) This is gonna run the same number of times as there are |
|
ok. profiling https://github.com/mmarton/phpstan-issue8146/blob/master/src/DataFixtures/LocationFixtures.php I can see the top consumer is now this makes me think of #1290 which deletes said |
|
Nope, that's completely unrelated to the arrays, it just means there's a lot of dependencies in vendor and otherwise the project (analysed files) is relatively small. #1290 is going to be slower than the current solution with PhpFileCleaner. |

23% speedup of phpstan/phpstan#8504