Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET MVC 2 to MVC 4 converted project runs slower
    primarykey
    data
    text
    <p>Recently we have converted the ASP.NET MVC 2 project to ASP.NET MVC 4.</p> <p>In MVC2 we had used LINQ to SQL. In MVC4 we are using Entity Framework. When comparing the loading speed MVC4 runs slower than MVC2. </p> <p>I have compared a basic page that just pulls the list of Contacts and both are having the same functionality and flow (Controller -> BLL -> Repository(DAL)). But MVC4 loads slower than MVC2.</p> <p><img src="https://i.stack.imgur.com/0DzXA.png" alt="Firebug of MVC2"> Above is screenshot of firebug from MVC2 application</p> <p><img src="https://i.stack.imgur.com/VIoNR.png" alt="Firebug of MVC4"> Above is screenshot of firebug from MVC4 application</p> <p>Both are the same functionality, but it differs in the time they load.</p> <p>How to find the loading issue in my MVC4? Is there any tool that points out any issues/leakage? Please suggest.</p> <p><strong>Update:</strong></p> <p>When i checked the loading speed by commenting the call to Database and still had the same issue. When i comment the Dependency Injection, it runs normal. When i use the Controller without any Interfaces like below, it loads faster: </p> <pre><code>public class UserController : BaseController { public UserController() { } } </code></pre> <p>But When i use the Interfaces(Dependency Injection) as below, it takes longer time:</p> <pre><code>public class UserController : BaseController { private IUserService _userService; private IPaymentService _paymentService; private ICommonService _commonService; private IAdminService _adminService; private IAUserService _adminUserService; public UserController() { } public UserController(IUserService userService, IPaymentService paymentService, ICommonService commonService, IAdminService adminService, IAUserService adminUserService) { this._userService = userService; this._paymentService = paymentService; this._commonService = commonService; this._adminService = adminService; this._adminUserService = adminUserService; } } </code></pre> <p>I have posted a thread at <a href="http://forums.asp.net/p/1785359/4899828.aspx/1?RE%20Performance%20issue%20after%20upgrading%20MVC2%20from%20L2S%20to%20EF" rel="nofollow noreferrer">ASP.NET forum</a>, which gave me the idea to check by removing the Dependency Injection.</p> <p>Also in Scott Gu's <a href="http://weblogs.asp.net/scottgu/archive/2012/02/19/asp-net-mvc-4-beta.aspx" rel="nofollow noreferrer">blog post</a>, but no positive response so far.</p> <p>Its something fishy with the Dependency Injection, any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload