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

Appearance settings

[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

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

bastnic
Copy link
Contributor

@bastnic bastnic commented Jun 22, 2023

Q A
Branch? 6.4
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

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.

image

image

@bastnic bastnic force-pushed the perf/resolve-string-value branch from cd94d75 to 2e54672 Compare June 22, 2023 08:38
@bastnic bastnic requested a review from dunglas as a code owner June 22, 2023 08:38
@@ -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) {
Copy link
Contributor Author

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

Copy link
Member

Choose a reason for hiding this comment

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

And ResolveEnvPlaceholdersPass also :)

@bastnic bastnic force-pushed the perf/resolve-string-value branch 2 times, most recently from f131904 to 470bc1f Compare June 22, 2023 08:44
@nicolas-grekas nicolas-grekas changed the title [DependencyInjection] reduce string process [DependencyInjection] Skip scanning scalar values in compiler passes when no needed Jun 22, 2023
@nicolas-grekas nicolas-grekas force-pushed the perf/resolve-string-value branch from 470bc1f to 485574a Compare June 22, 2023 08:50
@nicolas-grekas nicolas-grekas changed the title [DependencyInjection] Skip scanning scalar values in compiler passes when no needed [DependencyInjection] Skip scanning scalar values in compiler passes when not needed Jun 22, 2023
@nicolas-grekas nicolas-grekas force-pushed the perf/resolve-string-value branch 2 times, most recently from b50509b to 5e2e97f Compare June 22, 2023 09:07
@ghost
Copy link

ghost commented Jun 22, 2023

image

image

Are you profiling the same app guys 😃 ?

@bastnic
Copy link
Contributor Author

bastnic commented Jun 22, 2023

@javaDeveloperKid guilty. I used the famous github function "ask a core contrib". Costs me a lot of coffee and beers.

@nicolas-grekas nicolas-grekas force-pushed the perf/resolve-string-value branch from 5e2e97f to 9a4fa3f Compare June 26, 2023 07:24
@nicolas-grekas nicolas-grekas force-pushed the perf/resolve-string-value branch from 9a4fa3f to f9f2baa Compare June 26, 2023 07:26
@nicolas-grekas
Copy link
Member

Thank you @bastnic.

@nicolas-grekas nicolas-grekas merged commit a8872de into symfony:6.4 Jun 26, 2023
@bastnic bastnic deleted the perf/resolve-string-value branch June 29, 2023 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.