Skip to content

Enum-case comparison: cheap checks first#3060

Merged
ondrejmirtes merged 1 commit intophpstan:1.11.xfrom
staabm:cheap-enum
May 11, 2024
Merged

Enum-case comparison: cheap checks first#3060
ondrejmirtes merged 1 commit intophpstan:1.11.xfrom
staabm:cheap-enum

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
@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

Development

Successfully merging this pull request may close these issues.

2 participants