Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1090281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:21:06+00:00 2026-05-16T23:21:06+00:00

I have an asp.net view/page (dynamic) that is built up of nested Html.RenderPartials. The

  • 0

I have an asp.net view/page (dynamic) that is built up of nested Html.RenderPartials. The view is sent an appropriate viewmodel to render.

Firebug says the GET response for the HTML is 9.89 secs for 9.5KB.
To compare the FAQ page (static html) of the same site is 1.3 secs for 17K.

At first I thought it was the SQL Entity back end slowing things down due to the complexity of the viewmodel but it seems to construct the viewmodel in less than 1 sec according to my logs.

Any ideas why the MVC view is taking so long to render please and how I can speed this up? I’m considering partial loading via ajax.

(btw I Gzip and use CDN’s etc – I have yslowed the whole site to death)

Edit:

Added timers (Stopwatch) to OnActionExecuting/OnActionExecuted and OnResultExecuting/OnResultExecuted.

09/12/2010 18:39:20: Controller: Profile Action: Index Elapsed time: 680.6431 – Action

09/12/2010 18:39:29: Controller: Profile Action: Index Elapsed time: 9202.063 – Result

9 seconds for the framework to render the view.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:21:07+00:00Added an answer on May 16, 2026 at 11:21 pm

    Problem Solved

    Firstly thanks to you all for your suggestions. I followed each suggestion again and again until I found the issue. This is what was wrong, and maybe someone could clarify for others.

    VS2010 Performance Wizard was saying that each object being passed to the PartialViews was taking up huge CPU time and I presumed it to be the partial as I have read they may have issues.

    foreach (ProfileComment item in Model)
    {
        Html.RenderPartial("UserActivityComment", item);
    }
    ...
    Friends friend = Model.Friends.Where(e => e.ID == activity.ActionID).FirstOrDefault();
    if (friend.FriendsProfile.UserName != Page.User.Identity.Name)
    {
        Html.RenderPartial("UserActivityFriend.ascx", friend);
    }
    

    The ProfileComment and Friends object (plus others) are part of a ViewModel I generate and pass to the page. Now the VM is generated via the Entity Framework in less than 0.3 secs So I presumed all was fine with the VM.

    The huge delay came when I wanted the view to Process it. The Model in the ‘for loop’ was flagged, and so was FirstOrDefault by the Performace Wizard.

    Hmm strange, the model is constructed rapidly but not processed rapidly. Solution:

    _entities.Friends.MergeOption = MergeOption.NoTracking;
    _entities.ProfileComment.MergeOption = MergeOption.NoTracking;
    

    I think the issue was extracting the object from the VM to send to the partial as it was also wanting to maintain entity management for relationships.

    More info at Aia Research

    and blogs.microsoft.co.il/blogs/gilf/archive/2009/02/20/disabling-change-tracking-in-entity-framework.aspx

    Please feel free to expand on this in more detail. Btw the performance increase was huge!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a decent size asp.net page open in Source view, and hold
I have a ASP.NET page with an asp:button that is not visible. I can't
I have an asp.net mvc register view. This is the first page. If someone
I am working with ASP.NET MVC and have a view page with a simple
I have an ASP.NET MVC view which contains checkboxes for user-defined categories. <td><% foreach
I have a custom view engine in ASP.NET MVC and since upgrading to RC1
I have asp.net form that contains fields. When I access this window, my javascript
I have a ASP.NET application that we've written our own logging module for. My
I have an ASP.NET MVC View with the typical TitleContent and MainContent, with a
i am porting over a website from asp. i have one page that i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.