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

Enum-case comparison: cheap checks first #3060

Merged
merged 1 commit into from May 11, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented May 10, 2024

calls to getClassName() show up in the profile of the phpstan/phpstan#10979 repro.

grafik

not super important but an easy low hanging fruit

@staabm
Copy link
Contributor Author

staabm commented May 11, 2024

after the root cause patch landed with #3062 this PR still shows a 14% improvement on the repro case of #10979

grafik

before

php bin/phpstan analyze --debug LibraryMasterEnum.php
  2.06s user 0.13s system 99% cpu 2.216 total

after

php bin/phpstan analyze --debug LibraryMasterEnum.php
  2.00s user 0.13s system 98% cpu 2.157 total

@ondrejmirtes ondrejmirtes merged commit 6c85acc into phpstan:1.11.x May 11, 2024
444 of 445 checks passed
@ondrejmirtes
Copy link
Member

Thank you.

@staabm staabm deleted the cheap-enum branch May 11, 2024 17:27
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