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

Lazier creation of parameter-acceptor #2843

Merged
merged 1 commit into from Jan 3, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Dec 25, 2023

we only need to create the acceptor for calls with at least 1 arg or if assert-tags are present


after this change running the repro of phpstan/phpstan#8865 is consistently 3-4 seconds faster.
(because we call getVariants() only 20 times, instead of 25 times)

before this PR ~ 46,5-47 seconds
after this PR ~ 43 seconds

php vendor/bin/phpstan analyze --memory-limit=1G -l 5 src/Pyz/Zed/CategoryDataImport/Business/QueryExpander/FooQueryExpander.php --debug -vvv 

Note: Using configuration file /Users/staabm/workspace/spryker-phpstan-issue/phpstan.neon.
Result cache not used because of debug mode.
/Users/staabm/workspace/spryker-phpstan-issue/src/Pyz/Zed/CategoryDataImport/Business/QueryExpander/FooQueryExpander.php
--- consumed 288.33 MB, total 356.5 MB, took 43.67 s
Result cache was not saved because only files were passed as analysed paths.
                                                                                                                        
 [OK] No errors                                                                                                         
                                                                                                                        
Used memory: 356.5 MB

before profile

grafik

@ondrejmirtes ondrejmirtes merged commit 256ff3d into phpstan:1.10.x Jan 3, 2024
424 of 427 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the lazy-variants branch January 3, 2024 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants