Skip to content

Lazier creation of parameter-acceptor#2843

Merged
ondrejmirtes merged 1 commit intophpstan:1.10.xfrom
staabm:lazy-variants
Jan 3, 2024
Merged

Lazier creation of parameter-acceptor#2843
ondrejmirtes merged 1 commit intophpstan:1.10.xfrom
staabm:lazy-variants

Conversation

@staabm
Copy link
Copy Markdown
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
@ondrejmirtes
Copy link
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

2 participants