Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Jan 7, 2026

in case we would know that a certain file does not contain any inline functions/class-definitions, we could skip deep traverse method/function/hook bodies.

testing suggests, this would save us 10 MB of memory when running
php bin/phpstan analyse src/Analyser/ src/Rules/ -v --debug

@staabm
Copy link
Contributor Author

staabm commented Jan 7, 2026

this PR doesn't work as is, since I did not find yet a way how we can cheaply identify whether a file contains inline classes/functions. any idea whether/how this can be checked?

@ondrejmirtes
Copy link
Member

Can we actually skip it? I think we still need to find all inline @var and @throws...

But there's a lot of time spent in FileTypeMapper, maybe there are ways to optimize it.

@staabm staabm closed this Jan 9, 2026
@staabm staabm deleted the dont-deep branch January 9, 2026 13:14
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