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

Optimize performance when comparing big enum-case unions #3061

Closed
wants to merge 2 commits into from

Conversation

staabm
Copy link
Contributor

@staabm staabm commented May 10, 2024

This change prevents the previous recursion which made comparisons against object types slow.

call graph before this PR:

https://blackfire.io/profiles/ad03e612-d5c9-410b-9bc4-763dfaa3d66b/graph

grafik

closes phpstan/phpstan#10979

Before this PR

php bin/phpstan analyze --debug LibraryMasterEnum.php
  23.67s user 0.14s system 99% cpu 23.858 total

After this PR

php bin/phpstan analyze --debug LibraryMasterEnum.php
  4.11s user 0.15s system 99% cpu 4.291 total

@staabm staabm closed this May 10, 2024
@staabm staabm deleted the fast-enum branch May 10, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant