Search code examples
asp.net-mvc-3castle-windsorninjectautofaccastle

Performance overhead of using IoC containers with MVC3


I have an MVC3 application that I hope will be serving a large number of user requests. I would like to use an IoC container but don't want it to slow down the performance of my application.

I read that I shouldn't be concerned as the only overhead is at the time of initialization. However for an MVC3 application is this not EVERY time a user requests a new web page?


Solution

  • No, it is not every time the user requests a page. The IoC container should be configured once for the lifetime of the application (in your global Application_Start event handler, for instance) and then shouldn't require any additional configuration while the application runs.