Skip to content
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

Closed
mnapoli opened this issue Jul 19, 2013 · 1 comment
Closed

Optimize definition lookup #86

mnapoli opened this issue Jul 19, 2013 · 1 comment

Comments

@mnapoli
Copy link
Member

@mnapoli 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
Copy link
Member Author

@mnapoli 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant