V3.0.0 Release - Updated to latest Autofac + Improvements - #4
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed
decorated properties went from ~3.2s to ~1.0s, a component without any from ~2.0s to ~0.7s. Two things
got it there:
collected once per type and cached. Previously every single resolve called
GetProperties()on theconcrete type and asked every property for its attributes
PropertyInfo.SetValue, which also removesthe boxing of every assignment
Registeredevent and every registration's
PipelineBuildingevent. One middleware instance is shared by the wholecontainer instead of allocating one per component registration, and
AddEasyPropInject()may be called atany point while configuring the builder — before, after or in between registrations. The README used to
claim it had to come first; that restriction is gone and is covered by tests
NewInstanceActivated), ratherthan relying on the resolve pipeline to short-circuit before the middleware is reached
InvalidOperationExceptionnaming the type and theproperty instead of an opaque
ArgumentExceptionfrom deep inside reflectionFromAutofacAttributeissealedand itsResolveFromRegisteredTypeis annotated as nullableFixed
return non-public members of base types, so the type hierarchy is now walked explicitly
null, silentlywiping any value assigned in the constructor. The result of the resolve attempt is now respected — see
UnresolvedPropertyBehaviorif you relied on the old behaviour