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

A large array in source code locks up phpstan since version 0.12.95 #5500

Closed
xPaw opened this issue Aug 21, 2021 · 6 comments
Closed

A large array in source code locks up phpstan since version 0.12.95 #5500

xPaw opened this issue Aug 21, 2021 · 6 comments

Comments

@xPaw
Copy link

xPaw commented Aug 21, 2021

Bug report

Happens in 0.12.95 and 0.12.96. It worked fine in 0.12.94.

phpstan seemingly just gets stuck on that file and does not quit.

Code snippet that reproduces the problem

Expected output

phpstan doesn't lock up

@mergeable
Copy link

mergeable bot commented Aug 21, 2021

This bug report is missing a link to reproduction on phpstan.org.

It will most likely be closed after manual review.

@ondrejmirtes
Copy link
Member

I was able to bring it down to a minute with this optimization: phpstan/phpstan-src@5a44c29

@xPaw
Copy link
Author

xPaw commented Aug 22, 2021

Is that sort really so slow? Seems odd.

@xPaw
Copy link
Author

xPaw commented Aug 22, 2021

I tried f7ede5f build, and it is still slow. There is definitely a regression that happened since 0.12.94.

@ondrejmirtes
Copy link
Member

The "regression" is that huge union stays a union and is interpreted precisely.

With dev-master at least it finishes in a reasonable amount of time.

One way to solve this is not to analyse files like that - there's little value in that.

@github-actions
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 Sep 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants