Copied to clipboard

Flag this post as spam?

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


  • mithun 42 posts 63 karma points
    Aug 11, 2012 @ 08:11
    mithun
    0

    Performance Increase

    Hi ,

     Using Xslt,Razor or Macro which help the performance increases and load page fastly..

     

     

     

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Aug 11, 2012 @ 23:44
    Bo Damgaard Mortensen
    1

    Hi mithun,

    I honestly don't think there's that much (if any) difference, performance wise, if you use XSLT or Razor :-) As for macros: they're basically just "containers" which holds a reference to your XSLT, .NET controls or Razor files.

    So, I'd say: go for whatever you like :-)

    All the best,

    Bo

  • mithun 42 posts 63 karma points
    Aug 13, 2012 @ 07:47
    mithun
    0

    Hi Bo Mortensen,

    Thankz for reply... 

    regards

    Mithun

     

  • Jamie Howarth 306 posts 773 karma points c-trib
    Aug 13, 2012 @ 09:10
    Jamie Howarth
    2

    Hi Mithun,

    XSLT & Razor macros are comparable in performance, as they both use the underlying umbraco.config XML cache to populate their data in memory, except when you are using .NET XSLT extensions - then Razor macros are faster, as they are compiled & have easier in-memory access to .NET classes & methods than XSLT does.

    Here's a quick (but not exhaustive) performance guide:

    • Inline page macros (using the <umbraco:Macro language="xslt/cshtml"> markup) are slower than configuring a specific macro in memory, as the inline macro is compiled at runtime and creates un-necessary temp files on disk in your App_Data folder. A pre-configured macro can be cached in memory;
    • XSLT is normally faster than Razor unless you need helper methods - in which case, use Razor, as XSLT takes longer to load & call .NET helper methods;
    • Usercontrols are never cached, even if you select caching options in the macro's config, unless you write your own cache mechanism in the code-behind of the usercontrol - therefore for read-only presentation data, avoid them wherever possible;
    • If using usercontrols or Razor, and you only need read-only data (without previous version information), use the Node classes in the umbraco.NodeFactory namespace, or the DynamicNode classes in the umbraco.MacroEngines namespace, rather than the Document class in umbraco.cms.businesslogic.web. The Document class populates data from the database which has a performance hit, but subsequently can be used to access previous document version data, along with editing document content & properties (Node & DynamicNode only provides a read-only class view of a document).
    I hope this is a good guide to better performance within your Umbraco site.
    Best,
    Benjamin
  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Aug 13, 2012 @ 10:38
    Jeroen Breuer
    1

    If you're using Razor it could have some performance problems if you don't know how to do some things properly. More info here: https://groups.google.com/forum/#!topic/umbraco-dev/ZzP2L0c_znA%5B1-25%5D.

    Jeroen

  • Jamie Howarth 306 posts 773 karma points c-trib
    Aug 13, 2012 @ 10:44
    Jamie Howarth
    0

    Jeroen - great spot, thanks for the heads-up. Might look into this - I personally thought DynamicNode was a full replacement for XSLT on the umbraco.config.

    Best,

    Benjamin

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Aug 13, 2012 @ 12:20
    Jeroen Breuer
    0

    The more I use Razor and DynamicNode the more I get a feeling that it's not mature yet. In 4.7 Razor added some great features, but the fact that it has an XPath method already says that you can't do everything with it yet. I Already explained here that I would like to use some LINQ queries in Razor to query my data: https://groups.google.com/d/msg/umbraco-dev/PaCfxpLZsY4/eiBc-JIvjgMJ.

    Jeroen

  • Steve Bridges 51 posts 72 karma points
    Aug 13, 2012 @ 17:14
    Steve Bridges
    0

    "Usercontrols are never cached, even if you select caching options in the macro's config, unless you write your own cache mechanism in the code-behind of the usercontrol - therefore for read-only presentation data, avoid them wherever possible;"

    Wow.  Really?  Why is this the case??  That's a major dissapointment - part of what i liked about Umbraco is the flexibility to build in xslt,razor, or traditional .net usercontrols.

    Why is it that usercontrols are not cached even when setting them to be cached?  Is this something that can be considered a bug and fixed?

    Thanks



Please Sign in or register to post replies

Write your reply to:

Draft