Copied to clipboard

Flag this post as spam?

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


  • Ric Carey 50 posts 93 karma points
    Jul 04, 2013 @ 14:56
    Ric Carey
    0

    Macro Peformance

    Doing some work on an 4.11 site

    Is it better, performance wise to have one big macro or lots of individual ones?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 04, 2013 @ 15:58
    Jan Skovgaard
    0

    Hi Ric

    You should have more individual macroes I suppose depending on what it is you want to achieve? It makes sense to have a macro to render main navigation a macro for sub navigation, a macro for meta data, a macro for content etc.

    However some content could also come from macroes inserted into a rich text editor field.

    So in order to be able to better anwer your question could you ellaborate a bit more about details about the site you're building and your thoughts about it? Are you going to be using Razor or XSLT? etc. etc. etc.

    /Jan

  • Ric Carey 50 posts 93 karma points
    Jul 04, 2013 @ 16:10
    Ric Carey
    0

    Its razor, i was really wondering more about if compile speed would be affected if theres more on one page or whether it would be quicker to just have one big one.

    For example if you have a home page which had multiple rotators on of which youd make in a razor macro by getting the nodes etc.

    How much would it affect performance to either group all the sliders and page content in one macro in one masterpage, or to put multiple macros in one masterpage.

    It would do the same job, and i know what i want to do isnt exactly performance heavy anyway, i just wondered.

    Just the way this is set up is more webforms and im used to MVC so im used to a view rather than a masterpage and a seperate view, if that makes sense?

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Jul 06, 2013 @ 01:13
    Kevin Jump
    0

    If you are concerned about performance I would cache the Razor Macros using the cache period in the macro settings. 

    I have found this significantly speeds up content rendering - especially when you are traversing nodes for things like sliders.

    You can run into issues if you use the client dependency framework, as the umbraco cached macro's won't inject any javascript into the correct place. but then we split the macro so the client dependency scripts where not cached but the razor that produced the slider was. 

    Kevin 

Please Sign in or register to post replies

Write your reply to:

Draft