Skip to content

Properly cache late resolvable types results#1518

Merged
ondrejmirtes merged 1 commit intophpstan:1.8.xfrom
rvanvelzen:late-resolvable-cached-resolved
Jul 18, 2022
Merged

Properly cache late resolvable types results#1518
ondrejmirtes merged 1 commit intophpstan:1.8.xfrom
rvanvelzen:late-resolvable-cached-resolved

Conversation

@rvanvelzen
Copy link
Copy Markdown
Contributor

This was already supposed to happen, but wasn't implemented correctly. Fixes phpstan/phpstan#7637

This was already supposed to happen, but wasn't implemented correctly
@staabm
Copy link
Copy Markdown
Contributor

staabm commented Jul 18, 2022

thx for working on the problem.

I can confirm that with the patch applied on my windows box the analysis now is ~2 seconds faster then before.

without the patch it takes 8-8.5 seconds. with the patch applied its 6-6.5.
a solid improvement - but I hope we can get even better.

@staabm
Copy link
Copy Markdown
Contributor

staabm commented Jul 18, 2022

I ran another test with the pathological example of phpstan/phpstan#7637 (comment)

before this PR I had to interrupt phpstan after 47 minutes and with the patch it finished in 7 seconds.
so its already a major improvement! thank you!

@ondrejmirtes ondrejmirtes merged commit 9b620bb into phpstan:1.8.x Jul 18, 2022
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

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.

analyzing a complex conditional return type is slow

3 participants