-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Skip scanning scalar values in compiler passes when not needed #50743
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
6f49b6a
to
cd94d75
Compare
src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Compiler/AbstractRecursivePass.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php
Outdated
Show resolved
Hide resolved
cd94d75
to
2e54672
Compare
@@ -77,6 +78,9 @@ protected function processValue(mixed $value, bool $isRoot = false) | ||
{ | ||
if (\is_array($value)) { | ||
foreach ($value as $k => $v) { | ||
if (\is_scalar($v ?? true) && $this->skipScalars) { |
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 point is that only ResolveParameterPlaceHoldersPass
should NOT skip that
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.
And ResolveEnvPlaceholdersPass
also :)
f131904
to
470bc1f
Compare
470bc1f
to
485574a
Compare
b50509b
to
5e2e97f
Compare
@javaDeveloperKid guilty. I used the famous github function "ask a core contrib". Costs me a lot of coffee and beers. |
5e2e97f
to
9a4fa3f
Compare
9a4fa3f
to
f9f2baa
Compare
Thank you @bastnic. |
While profiling an app with ~2600 auto-discovered services, I figured out that we have a way bigger calls to string process that logic would expect.