Skip to content

ExprCacheHelper: Reduce PHPParser instantiation#41

Closed
staabm wants to merge 1 commit into
ondrejmirtes:6.65.xfrom
staabm:faster
Closed

ExprCacheHelper: Reduce PHPParser instantiation#41
staabm wants to merge 1 commit into
ondrejmirtes:6.65.xfrom
staabm:faster

Conversation

@staabm
Copy link
Copy Markdown

@staabm staabm commented Feb 22, 2026

ReflectionConstant/ReflectionParameter->importFromCache() is expensive.
it is dominated by PHPParser overhead

Image

looks like the parser instantiation happens multiple times


before/after PR when running PHPStan on a single file change

grafik

covered by test in phpstan/phpstan-src#5023


/**
* @return array<string, mixed
* @return array<string, mixed>
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes me feel this repo is missing a phpstan job

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has all the CI checks but it's a failing mess. Because it's tricky to support all of the PHP versions at the same time, so for a long time I was fine by checking manually PHPUnit and knew what tests were failing before.

@ondrejmirtes
Copy link
Copy Markdown
Owner

Merged, released as 6.65.0.10. Thank you!

@staabm staabm deleted the faster branch February 26, 2026 12: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