6d3f63d6f3
This PR was merged into the 4.2-dev branch.
Discussion
----------
[DI] Add ServiceLocatorArgument to generate array-based locators optimized for OPcache shared memory
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | -
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Right now, to generate service locators, we use collections of closures described using `ServiceClosureArgument`. This works well, but it doesn't scale well when the number of services grows, because we have to load as many closures as there are services, even if we never call them.
This PR introduces `ServiceLocatorArgument`, which describes the same thing, but allows dumping optimized locators: instead of a collection of closures, this generates a static array that OPcache can put in shared memory (see fixtures for example.)
Once this PR is merged, we'll be able to update `ServiceLocatorPass::register()` to leverage it and generate these optimized locators everywhere. One particular I have in mind in the locator used by `ServiceArgumentResolver`, which can grow fast (it has as many entries as there are actions.)
Commits
-------
|
||
---|---|---|
.. | ||
Argument | ||
Compiler | ||
Config | ||
Dumper | ||
Extension | ||
Fixtures | ||
LazyProxy | ||
Loader | ||
ParameterBag | ||
ChildDefinitionTest.php | ||
ContainerBuilderTest.php | ||
ContainerTest.php | ||
CrossCheckTest.php | ||
DefinitionTest.php | ||
EnvVarProcessorTest.php | ||
ParameterTest.php | ||
ReferenceTest.php | ||
ServiceLocatorTest.php | ||
ServiceSubscriberTraitTest.php |