-
Notifications
You must be signed in to change notification settings - Fork 544
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
Conversation
There was a problem hiding this 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.
src/DependencyInjection/AutowiredAttributeServicesExtension.php
Outdated
Show resolved
Hide resolved
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
grafikbefore
➜ 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
src/DependencyInjection/AutowiredAttributeServicesExtension.php
Outdated
Show resolved
Hide resolved
20f2f27
into
phpstan:2.1.x
Thank you!
Uh oh!
There was an error while loading. Please reload this page.
even after #4482 we still see this method call on the hot path.
grafikrunning PHPStan on the PHPStan-PHPUnit extension tests show this path as the slowest part of the run:
grafik