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] Container building optimization #47176

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
Oct 20, 2022
Merged

[DependencyInjection] Container building optimization #47176

merged 1 commit into from
Oct 20, 2022

Conversation

sveneld
Copy link
Contributor

@sveneld sveneld commented Aug 3, 2022

Q A
Branch? 6.2
Bug fix? no
New feature? no
Deprecations? no
License MIT

When you have to much env variables and many services in your container, container compilаtion can take much time due to the function stripos which is called much time.

It happens because method freezeAfterProcessing try to find env placeholders in config, but make it in two foreach.
So i offer to get all possible placeholders with preg_match_all and do not use stripos for each placeholed.

Same situation with method resolveEnvPlaceholders. But in this method we should left stripos for hard cases when in value could be something like this 'env_1418b707a69b8575_const_HOST_74bcc04c4799f2ca10fb754fe5581c89env_1418b707a69b8575_const_CORE_URL_91ef68034c1e9e8b58c13725d3bafdc0'

In my project it helps me to save 40 seconds in container building.

Related to my previous fix #44876

@sveneld
Copy link
Contributor Author

sveneld commented Aug 4, 2022

@nicolas-grekas can you look?

@xabbuh xabbuh modified the milestones: 5.4, 6.2 Aug 4, 2022
@xabbuh
Copy link
Member

xabbuh commented Aug 4, 2022

Adding this to the 6.2 milestone as performance optimisations should be handled as new features.

@sveneld
Copy link
Contributor Author

sveneld commented Oct 6, 2022

@nicolas-grekas can you look once again?

@nicolas-grekas nicolas-grekas added the ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" label Oct 19, 2022
@nicolas-grekas nicolas-grekas changed the base branch from 5.4 to 6.2 October 19, 2022 13:20
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

(rebased for 6.2 and tweaked a bit)

@sveneld
Copy link
Contributor Author

sveneld commented Oct 19, 2022

(rebased for 6.2 and tweaked a bit)

Will be this optimization available in 5.4?

@nicolas-grekas
Copy link
Member

5.4 accepts only bug fixes now. Only 6.2 gets improvements.

@sveneld
Copy link
Contributor Author

sveneld commented Oct 19, 2022

5.4 accepts only bug fixes now. Only 6.2 gets improvements.

Too bad for my project, but it will a motivation for updating %)

@fabpot
Copy link
Member

fabpot commented Oct 20, 2022

Thank you @sveneld.

@fabpot fabpot merged commit 63c554b into symfony:6.2 Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DependencyInjection Performance ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" Status: Reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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