You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even though we cache (keying off the type) each ResolveStrategy used to successfully create a Dummy, we still may be doing significant work on subsequent calls. If the ResolveByCreatingFakeStrategy or ResolveByInstantiatingClassUsingDummyValuesAsConstructorArgumentsStrategy are cached, invoking them will still require re-enumerating the constructors and possibly creating many extra constructor arguments. We could consider adding additional caching so we don't have to redo all this work.
Ideas:
have each resolver replaced by a "resolver source" that emits a list of resolvers based on the type being created. Most of these would just return the existing single resolver, but the "constructor-enumerating" resolvers could emit one resolver per constructor until one worked, and that one would then be cached. This is a little awkward for most of the resolvers, and is quite tricky for the ResolveByCreatingFakeStrategy, since it currently just calls to IFakeObjectCreator.TryCreateFakeObject, which handles the constructors internally.
Add constructor (or argument type) caching to ResolveByInstantiatingClassUsingDummyValuesAsConstructorArgumentsStrategy and FakeObjectCreator. This would keep the shape of all the other ResolveStrategys as is, and would have the benefit that the cached constructor (or argument types) would aid in Fake creation even when the Fake isn't being created to be a Dummy.
Even though we cache (keying off the type) each
ResolveStrategy
used to successfully create a Dummy, we still may be doing significant work on subsequent calls. If theResolveByCreatingFakeStrategy
orResolveByInstantiatingClassUsingDummyValuesAsConstructorArgumentsStrategy
are cached, invoking them will still require re-enumerating the constructors and possibly creating many extra constructor arguments. We could consider adding additional caching so we don't have to redo all this work.Ideas:
ResolveByCreatingFakeStrategy
, since it currently just calls toIFakeObjectCreator.TryCreateFakeObject
, which handles the constructors internally.ResolveByInstantiatingClassUsingDummyValuesAsConstructorArgumentsStrategy
andFakeObjectCreator
. This would keep the shape of all the otherResolveStrategy
s as is, and would have the benefit that the cached constructor (or argument types) would aid in Fake creation even when the Fake isn't being created to be a Dummy.(From #1347)
The text was updated successfully, but these errors were encountered: