Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mounhim Tahtahi 41 posts 62 karma points
    Oct 19, 2010 @ 10:21
    Mounhim Tahtahi
    0

    Performance with multiple usercontrols on one page

    Hi,

    I have a question regarding best practices. I have the following issue: 

    For my employer I created a site about the employees. One of the parts is a resumé. The resumé template consists of multiple areas, like profile, experience, education etc. Each area is a user control. 

    Now when the employee has a large resumé the followig problems occur

    1. Loading of the page is slow: I think this is because each usercontrol creates it's own connection to the database (separate database for the resumé's) and loads it's own data. Better would be to have one usercontrol to load the complete resumé and the other usercontrols containing each area should tap in on that usercontrol. Is that possible?

    2. Editing is not user friendly. Each usercontrol is a asp.net DataList control. The edit mode is a dialog form (using jquery UI plugin). The editing makes the page jump to top and after updating you have to scroll down again. I think AJAX is the solution here, but I find it hard to use when using the .Net datacontrols and the jquery UI plugins. 

    This is how I think I should proceed:

    Redesign the page and have the following design elements:

    1. Create a base library for retrieving and manipulating data.

    2. One method for getting the complete resumé.

    3. Have the resumé areas be built using the xml returned on page level by the method in previous bullet.

    4. Edits of an item AJAX style by using the base library and having only that item updated without reloading the entire page.

    Do you have any thoughts for this?

  • Yannick Smits 321 posts 718 karma points
    Oct 19, 2010 @ 10:36
    Yannick Smits
    0

    It's really hard to give a good advice here as performance can be related to many factors. Things that come to mind:

    • internet connection with database: are your umbraco install and the db on same machine?
    • query optimization: are you using cursors or other loops? What could help is to combine all queries into one and get the different dataset tables in 1 call.
    • bulky (table based) HTML (read about CSS zen)
    • large viewstate (disable viewstate on controls that don't need it)
    • Server busy with other tasks
    As for the AJAX editing you can just wrap your user controls in updatepanels to see if that makes your page refreshes speedier on edits.
    Hope that helps a bit in finding the performance issue.

     

  • Josh Townson 67 posts 162 karma points
    Oct 19, 2010 @ 12:13
    Josh Townson
    0

    Might I suggest caching the output of the Macros as a very easy/lazy fix? Give each of them a cache time of a couple of hours (or even a day) - I imagine the data won't change much on an hour by hour basis :)

Please Sign in or register to post replies

Write your reply to:

Draft