-
Notifications
You must be signed in to change notification settings - Fork 461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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