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

Faster ObjectType->getEnumCases() type substraction #3204

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Jul 2, 2024

turns a nested loop into 2 subsequent loops.


repro of phpstan/phpstan#11263

before this PR (c6b961d)

time php bin/phpstan analyze slow.php --debug
 8.52s user 0.14s system 99% cpu 8.732 total
time php bin/phpstan analyze slow.php --debug
 8.44s user 0.15s system 99% cpu 8.624 total

after this PR

time php bin/phpstan analyze slow.php --debug
 7.83s user 0.14s system 99% cpu 8.010 total
time php bin/phpstan analyze slow.php --debug
 7.80s user 0.14s system 99% cpu 7.979 total

@ondrejmirtes ondrejmirtes merged commit 3a11805 into phpstan:1.11.x Jul 2, 2024
450 of 454 checks passed
@staabm staabm deleted the fast branch July 2, 2024 09:52
@ondrejmirtes
Copy link
Member

Thank you.

@thg2k
Copy link
Contributor

thg2k commented Jul 2, 2024

There is a typo in the local variable name subtracedEnumCaseNames

@ondrejmirtes
Copy link
Member

@thg2k Please send a PR.

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.

3 participants