When requiring to use dependency injection, I always use IoC containers such as Ninject, Unity, or the built-in one in ASP.Net Core MVC. However, I've just come across the idea of "why not creating an object factory" and then instead of intercepting calls to parameterized constructors (via IoC containers), retrieve those objects from the factory in a parameterless constructor. For instance:
Dictionary<Type, Func<Object>> TransientFactory; Dictionary<Type, Object> SingletonFactory;
In my opinion, this technique would speed up the whole thing, but I'm not sure to what extent that would be true and that is the point of the question. Considering the fact that the life-cycle of the object can be easily controlled in consuming context, what possible advantages can an IoC container provide in this case?