-
-
Notifications
You must be signed in to change notification settings - Fork 324
Optimize definition lookup #86
Copy link
Copy link
Closed
Labels
Milestone
Description
Optimize definition lookup when finding a ValueDefinition or a ClosureDefinition (do not look into the next sources)
from #83:
So in theory, if you do
$container->set("SomeKey", $SomeDependency);, we know that there is no point in looking in other DefinitionSources...So yes I guess this behavior can be optimized, there are a couple of things to do:
- right now,
DefinitionSourcesare called from least priority to highest priority, so this order needs to be reversed (with all associated behavior) so that value defined in the code are searched first and reflection last.- once this is done: as soon as a Value/Closure definition is found, return it directly and ignore other definition sources (since even if they return a definition, it will be ignored anyway)
Reactions are currently unavailable