Skip to content

Optimize definition lookup #86

@mnapoli

Description

@mnapoli

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, DefinitionSources are 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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions