Skip to content

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

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

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
@ondrejmirtes
Copy link
Member

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
Development

Successfully merging this pull request may close these issues.

2 participants