I am doing a code review on a web site that will have a lot of simultaneous users, ca. 100,000 authenticated users.
I have found the following code of type:
[Inject]
public BusinessLayer.ILoginManager LoginManager { get; set; }
And in global.asax.cs:
protected Ninject.IKernel CreateKernel()
{
return new StandardKernel(new ServiceModule());
}
internal class ServiceModule : NinjectModule
{
public override void Load()
{
Kernel.Bind<IReportProxy>().To<ReportProxy>().InRequestScope();
}
}
Question is: Will the use of Ninject affect performance? Are there situations in which you should not use Ninject due to performance?
As it always is with performance questions and issues, you cannot detect any of those just by looking at your code. Rather, profile your application and see where the problem is.
From my past experience, IoC containers only incur performance overhead on application startup and their impact is next to negligible while the app is running.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With