Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Jan 25, 2026

most time consuming user of TypeTraverser::map() is TemplateTypeHelper::resolveTemplateTypes:

grafik

while TypeTraverser::map() is the most time consuming method-call in shopware (and also in phpstan-src reference benchmark):

grafik

after this PR TypeTraverser::map() no longer is in the top 8 of slow calls, while beeing in top 2 before.


before this PR:

➜  phpstan-src git:(2.1.x) ✗ hyperfine 'php bin/phpstan analyse src/Analyser/ src/Rules/ -v --debug' -i --runs=3 --warmup=1
Benchmark 1: php bin/phpstan analyse src/Analyser/ src/Rules/ -v --debug
  Time (mean ± σ):     26.391 s ±  0.413 s    [User: 25.598 s, System: 0.780 s]
  Range (min … max):   25.959 s … 26.783 s    3 runs
 
  Warning: Ignoring non-zero exit code.

after this PR:

➜  phpstan-src git:(early-ret) ✗ hyperfine 'php bin/phpstan analyse src/Analyser/ src/Rules/ -v --debug' -i --runs=3 --warmup=1
Benchmark 1: php bin/phpstan analyse src/Analyser/ src/Rules/ -v --debug
  Time (mean ± σ):     25.841 s ±  0.046 s    [User: 25.103 s, System: 0.729 s]
  Range (min … max):   25.788 s … 25.872 s    3 runs
 
  Warning: Ignoring non-zero exit code.

@ondrejmirtes ondrejmirtes merged commit 085d75e into phpstan:2.1.x Jan 25, 2026
627 of 640 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the early-ret branch January 25, 2026 08:58
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