Skip to content

sharp performance dropoff with long inheritance chains #13425

@verfriemelt-dot-org

Description

@verfriemelt-dot-org

Bug report

heyho,

we have issues with a big legacy codebase to analyse long inheritance chains (about 35 classes extending each other).

repo to reproduce it: https://github.com/verfriemelt-dot-org/coverage-fail

$ git clone https://github.com/verfriemelt-dot-org/coverage-fail
$ cd coverage-fail
$ composer require --dev phpstan/phpstan
$ vendor/bin/phpstan analyse src plugins --debug
/home/easteregg/src/coverage-fail/src/Bundle/TICKeosMobileBundle/Service/V2022_03/MobileServiceApi.php

and there it will basically halt and run forever. if you run it only on the plugins (vendor/bin/phpstan analyse plugins --debug) folder of that repo, it will get there eventually, but with every other class added, it will get slower and slower to a point when it will never finish.

(the actual methods of that repository are bogus)

Code snippet that reproduces the problem

https://github.com/verfriemelt-dot-org/coverage-fail

Expected output

somewhat reasonable time to finish :)

Did PHPStan help you today? Did it make you happy in any way?

always :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions