Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Jan 11, 2026

make large enum analysis faster


the repro from phpstan/phpstan#11968

before this PR: 49.23 seconds
after this PR: 41.09 seconds

profile before PR:

grafik

Comment on lines +212 to +213
$enumCase = $types[$i]->getEnumCaseObject();
if ($enumCase !== null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

essence of this PR is here.

we move this operation into the type classes, in which we can calculate this single object more efficient

@ondrejmirtes ondrejmirtes merged commit 0e2eb5c into phpstan:2.1.x Jan 11, 2026
632 of 646 checks passed
@ondrejmirtes
Copy link
Member

Nice, thank you!

@staabm staabm deleted the eco branch January 11, 2026 18:51
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