Skip to content
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

Introduce oversized-array type to enforce max number of HasOffsetValueType accessory types #1666

Merged
merged 1 commit into from Sep 22, 2022

Conversation

rvanvelzen
Copy link
Contributor

@rvanvelzen rvanvelzen commented Aug 30, 2022

This is a generalization of e06f6f0 that replaces "too many" HasOffsetValueTypes with an "oversized array" type.

@ondrejmirtes
Copy link
Member

ondrejmirtes commented Aug 30, 2022

Hi, did you accidentally tried to implement the same thing as I already did here? :) e06f6f0 Or is this achieving a different optimization in a different place?

Yours might be a bit more precise, because mine simply keeps the last 32 HasOffsetValueTypes, but yours simply attaches a new type. If you agree, feel free to revert my commit and keep only your logic in this PR.

Also, I'd argue this actually doesn't solve phpstan/phpstan#7581 (which is the issue I'm trying to solve in phpstan/phpstan#7666 (but no one actually attempted it yet).

phpstan/phpstan#7581 is about optimizing TypeCombinator::reduceArrays() so that it doesn't compare everything with everything, but does something smarter with the arrays, like putting them into smaller buckets before, or something like that.

@rvanvelzen
Copy link
Contributor Author

rvanvelzen commented Sep 22, 2022

I don't really like the name, but I couldn't come up with something better.

@ondrejmirtes ondrejmirtes merged commit 81de3eb into phpstan:1.8.x Sep 22, 2022
221 of 224 checks passed
@ondrejmirtes
Copy link
Member

ondrejmirtes commented Sep 22, 2022

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants