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

Performance issue when analysing project with prinsfrank/standards #10772

Closed
ondrejmirtes opened this issue Mar 22, 2024 · 8 comments
Closed

Comments

@ondrejmirtes
Copy link
Member

Bug report

Repository: https://github.com/h4kuna/phpstan-long-run

Analysed file: https://github.com/h4kuna/phpstan-long-run/blob/main/src/test.php

Steps:

// 1. composer install
// 2. composer phpstan
//      - wait long time

// 3. let's comment part A
// 4. uncomment part B
// 5. remove phpstan cache
// 6. composer phpstan
//      - much faster!

Takes about 98 seconds on my machine.

Code snippet that reproduces the problem

No response

Expected output

Should be instant.

Did PHPStan help you today? Did it make you happy in any way?

No response

@ondrejmirtes
Copy link
Member Author

/cc @staabm You might want to look into this :) Why exactly is it slow.

Copy link

mergeable bot commented Mar 22, 2024

This bug report is missing a link to reproduction at phpstan.org/try.

It will most likely be closed after manual review.

@staabm
Copy link
Contributor

staabm commented Mar 22, 2024

I can have a look this afternoon

@ondrejmirtes
Copy link
Member Author

Thanks :)

@staabm
Copy link
Contributor

staabm commented Mar 22, 2024

the root cause of the problem is a explosion in enum-case-union-elements. still investigating...

grafik

https://blackfire.io/profiles/a352df89-1520-44e1-a5e7-1f031fffbc82/graph

@staabm
Copy link
Contributor

staabm commented Mar 22, 2024

6-8% faster by roave upstream change: Roave/BetterReflection#1410

@ondrejmirtes
Copy link
Member Author

Fixed phpstan/phpstan-src#2985

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants