Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Faster AutowiredAttributeServicesExtension->processParameters() #4489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
ondrejmirtes merged 6 commits into phpstan:2.1.x from staabm:fastp
Oct 28, 2025

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Oct 27, 2025
edited
Loading

even after #4482 we still see this method call on the hot path.

grafik

running PHPStan on the PHPStan-PHPUnit extension tests show this path as the slowest part of the run:

grafik

Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

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

The whole issue of something called a million times could be avoided by restructuring how vendor/attributes.php looks like, so that we don't have to iterate over so many things so many times.

Copy link
Contributor Author

staabm commented Oct 27, 2025

The whole issue of something called a million times could be avoided by restructuring how vendor/attributes.php looks like

I don't want to customize the vendor/attributes.php too much, so we stay as long as possible compatible with the upstream.
(at least not for only 5% gains).

I restructured the loops and the bootleneck no longer exists

grafik

Copy link
Contributor Author

staabm commented Oct 27, 2025

before

➜ phpstan-phpunit git:(2.0.x) hyperfine vendor/bin/phpunit 
Benchmark 1: vendor/bin/phpunit
 Time (mean ± σ): 2.636 s ± 0.066 s [User: 2.032 s, System: 0.183 s]
 Range (min ... max): 2.556 s ... 2.739 s 10 runs

with this PR

➜ phpstan-phpunit git:(2.0.x) hyperfine vendor/bin/phpunit
Benchmark 1: vendor/bin/phpunit
 Time (mean ± σ): 2.570 s ± 0.051 s [User: 1.974 s, System: 0.180 s]
 Range (min ... max): 2.451 s ... 2.625 s 10 runs

@ondrejmirtes ondrejmirtes merged commit 20f2f27 into phpstan:2.1.x Oct 28, 2025
541 of 555 checks passed
Copy link
Member

Thank you!

@staabm staabm deleted the fastp branch October 28, 2025 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ondrejmirtes ondrejmirtes ondrejmirtes requested changes

+1 more reviewer

@VincentLanglet VincentLanglet VincentLanglet left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /