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 problem - big arrays #8504

Closed
ondrejmirtes opened this issue Dec 11, 2022 · 7 comments
Closed

Performance problem - big arrays #8504

ondrejmirtes opened this issue Dec 11, 2022 · 7 comments

Comments

@ondrejmirtes
Copy link
Member

Feature request

This file https://github.com/mmarton/phpstan-issue8146/blob/master/src/DataFixtures/LocationFixtures.php from #8146 really slows PHPStan down, because it contains a lot of literal arrays.

The performance was better before: phpstan/phpstan-src#1741

This PR phpstan/phpstan-src#1830 looked promising, it improved the performance on 1.8.x, but after rebasing on 1.9.x, it's slow again.

This PR phpstan/phpstan-src#2077 (basically a revert of phpstan/phpstan-src#1741) helps to solve this problem by dumbing down huge constant arrays (making types less precise) at the cost of new false positives because of the lost precision.

@ondrejmirtes
Copy link
Member Author

@ondrejmirtes
Copy link
Member Author

The current result is that on 1.9.2, the sample project takes 2m34s to analyse, with 1.9.x-dev, it takes 47s! /cc @staabm

@staabm
Copy link
Contributor

staabm commented Dec 11, 2022

ahhh I love it. still too slow, but way better then before :)

@ondrejmirtes
Copy link
Member Author

Should be better now after phpstan/phpstan-src#2116 and phpstan/phpstan-src#2077 :)

Still need to investigate why #8004 fails on return.

@bcremer
Copy link

bcremer commented Dec 21, 2022

Can confirm a reduction from 8 to 6 minutes for a bigger Laminas MVC application 🥳

@SaschaHowe
Copy link

Hey,

just checked on this again. My Test case (this one: #8504 (comment)) went down for me this morning from 83.43s under 1.8.7 to 0.23s with 1.9.11. This is basically as good as it was prior to 1.8.7.

Great work and thank you so much 👍

Greetings,
Sascha

@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 Feb 14, 2023
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

4 participants