Copied to clipboard

Flag this post as spam?

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


  • Bart Grijseels 4 posts 24 karma points
    Oct 05, 2011 @ 13:17
    Bart Grijseels
    0

    Razor vs Response time

    Hi all,

     

    I'm currently running an umbraco v 4.7.0 website using razor.

    The initial page call after an app recycle for different types of pages (homepage / list overview / detail pages ) varies from 3 -> 8 ! seconds when nothing is cached (umbraco macro caching). The second call goes much smoother with a response time of minus 1 second. 

    Is this response time a known issue when using razor ? It seems like loading a macro is acting very slow ? 

     

    Since this website is deployed on a shared hosting, the app pool is recycled on a regular base. I'm not allowed to change this config or configure asp.net 4.0 prewarm triggers. 

    Using a ping service is could avoid the app pool to recycle but I would prefer fixing this problem without relying on a thirdparty service.

     

    Render time without cache (from tracing):

    renderMacro    Rendering started (macro: Top Banner, type: 6, cacheRate: 500000)    1,40895588685154 0,029033
    umbracoMacro MacroEngine script added (TopBanner.cshtml) 1,411046655371 0,002091
    umbracoMacro Loading IMacroEngine script 1,41295388101002 0,001907
    umbracoMacro Loading IMacroEngine script [done] 2,50642078811693 1,093467
    renderMacro Rendering started (macro: Top Navi, type: 6, cacheRate: 500000) 2,50835203915581 0,001931
    umbracoMacro MacroEngine script added (TopNavi.cshtml) 2,50842467408567 0,000073
    umbracoMacro Loading IMacroEngine script 2,50844953758089 0,000025
    umbracoMacro Loading IMacroEngine script [done] 2,69173763704605 0,183288

     

    Render time with cache (from tracing):

    renderMacro    Rendering started (macro: Top Banner, type: 6, cacheRate: 500000)    0,00280789876925699  0,000031
    renderMacro Macro Control loaded from cache ('1052-TopBanner-')... 0,00284086385280811 0,000033
    umbracoMacro Macro loaded from cache (ID: 2, Top Navi) 0,00289645751066127 0,000056
    renderMacro Rendering started (macro: Top Navi, type: 6, cacheRate: 500000) 0,00294031783369115 0,000044
    renderMacro Macro Control loaded from cache ('1052-TopNavi-')... 0,0029713273614384 0,000031

     

    Code sample Top banners:

    @using umbraco.MacroEngines;
    @using umbraco.cms.businesslogic.media;
    @inherits umbraco.MacroEngines.DynamicNodeContext
    @if (Model.HasProperty("banner") && Model.Media("banner") != null)
    {
        var image = @Model.Media("banner");
        <img src='@image.UmbracoFile' alt='@image.Name' />
    }
    else
    {
        Media startMedia = new Media(1060);
        Media randomItem  = startMedia.Children.OrderBy(T => Guid.NewGuid()).FirstOrDefault();
        if (randomItem != null)
        {       
            <img src='@randomItem.getProperty("umbracoFile").Value'  />
        }
    }

    Thanks in advance,

    Bart

  • Comment author was deleted

    Oct 14, 2011 @ 09:20

    Hi Bart,

    Could you check if it's still the same if you upgrade to 4.7.1 ?

    Also this post might be interesting: http://our.umbraco.org/forum/developers/razor/24853-Razor-Benchmarks-Interesting-Results

  • Bart Grijseels 4 posts 24 karma points
    Nov 08, 2011 @ 16:13
    Bart Grijseels
    0

    Hi Tim,

    I update the website and noticed the same initial loadtimes...

    Any feedback from the team ? For the moment I've scheduled a task to keep the application pool alive but not 100% happy with this workaround.

    Regards,
    Bart

    FYI: The update killed the "terrabyte" cropper datatype so I had to rollback afterwards but at least we're sure the upgrade doesn't fix this issue.

     

Please Sign in or register to post replies

Write your reply to:

Draft