Commit 63c554b
committed
minor #47176 [DependencyInjection] Container building optimization (sveneld)
This PR was merged into the 6.2 branch.
Discussion
----------
[DependencyInjection] Container building optimization
| 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
Commits
-------
c886e2c [DependencyInjection] Container building optimizationFile tree
3 files changed
+24
-3
lines changed- src/Symfony/Component/DependencyInjection
- Compiler
- Tests/Compiler
3 files changed
+24
-3
lines changedLines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
120 | 126 | | |
121 | 127 | | |
122 | | - | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1358 | 1358 | | |
1359 | 1359 | | |
1360 | 1360 | | |
1361 | | - | |
| 1361 | + | |
1362 | 1362 | | |
1363 | 1363 | | |
1364 | 1364 | | |
1365 | 1365 | | |
1366 | 1366 | | |
| 1367 | + | |
| 1368 | + | |
1367 | 1369 | | |
1368 | 1370 | | |
1369 | | - | |
| 1371 | + | |
1370 | 1372 | | |
1371 | 1373 | | |
1372 | 1374 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
156 | 169 | | |
157 | 170 | | |
158 | 171 | | |
| |||
0 commit comments