Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bzikarsky
Copy link

Before this change injectOn was not using the Container internal definition cache and insetad solely built on the optional SourceCache mechanism. This is costly for setups with a long-running processes with APCu as every injectOn call will lead to a full annotation and autowiring run.

This change makes injectOn use the definition cache for all objects of non-anonymous classes. Anonymmous objects are ignored to make sure the cache does not get overloaded with many unusable definitions. It also includes a basic test which tests for minimum compatibility of injectOn
with anonymous classes.

This PR is a simpler alternative to #647.

@bzikarsky bzikarsky mentioned this pull request Mar 20, 2020
3 tasks
Before this change `injectOn` was not using the Container internal
definition cache and insetad solely built on the optional SourceCache
mechanism. This is costly for setups with a long-running processes with
APCu as every `injectOn` call will lead to a full annotation and
autowiring run.

This change makes `injectOn` use the definition cache for all objects of
non-anonymous classes. Anonymmous objects are ignored to make sure the
cache does not get overloaded with many unusable definitions. It also
includes a basic test which tests for minimum compatibility of `injectOn`
with anonymous classes.
@bzikarsky bzikarsky force-pushed the use-definition-cache-for-inject-on branch from 55d6f1c to 90988ca Compare March 20, 2020 13:06
@mnapoli
Copy link
Member

mnapoli commented Mar 20, 2020

Thank you!

@mnapoli mnapoli merged commit df96a01 into PHP-DI:master Mar 20, 2020
@bzikarsky bzikarsky deleted the use-definition-cache-for-inject-on branch March 20, 2020 21:20
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.

3 participants