New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize definition lookup #86

mnapoli opened this Issue Jul 19, 2013 · 1 comment


None yet
1 participant
Copy link

mnapoli commented Jul 19, 2013

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)

mnapoli added a commit that referenced this issue Jul 28, 2013

@mnapoli mnapoli referenced this issue Jul 28, 2013


3.3 #90

7 of 7 tasks complete

This comment has been minimized.

Copy link

mnapoli commented Jul 28, 2013

Implemented in 3.3 (#90).

@mnapoli mnapoli closed this Jul 28, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment