Copied to clipboard

Flag this post as spam?

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


  • Harry Spyrou 199 posts 561 karma points
    May 31, 2018 @ 17:28
    Harry Spyrou
    0

    Is traversing umbraco slow?

    Hello everyone.

    I have a very generic question which is more of something I've been wondering. It's not of importance. So, I'm used to doing something like this:

    blabla.Parent()
    

    or

    blabla.first()
    

    or

    blabla.Ancestor('blibliblulu')
     blabla.Children
    
    blabla.Descendant('iWasOnceACowboy')
    

    The question is, is that way of traversing up and down the tree killing performance?

    If so, is there a better way of searching for nodes?

    Thanks in advance for any replies.

  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    May 31, 2018 @ 19:55
    Alex Skrypnyk
    2

    Hi Harry

    Querying with Descendants, DescendantsOrSelf is the worst traversing methods, avoid them.

    Read more about performance pitfalls - https://our.umbraco.org/documentation/reference/Common-Pitfalls/

    Thanks,

    Alex

  • Dave Woestenborghs 3325 posts 11170 karma points MVP 5x admin c-trib
    Jun 01, 2018 @ 07:25
    Dave Woestenborghs
    100

    Hi Harry,

    Depends on your site actually. If you only have 100 content items using descendants won't hurt your perfomance that much.

    But when you have 10000 content items this will become a bottle neck.

    I did a talk on how to optimize umbraco for speed. And also showed several alternatives to descendants.

    Slides can be found here : https://www.slideshare.net/dawoe/the-need-for-speed-uk-fest

    Also this article on the subject is interesting : https://skrift.io/articles/archive/testing-the-performance-of-querying-umbraco/

    But in the bottom line i avoid the use of descendants. Even a greed xpath query will give you better performance

    Dave

  • Harry Spyrou 199 posts 561 karma points
    Jun 01, 2018 @ 08:31
    Harry Spyrou
    0

    Exactly what I needed. Thanks so much!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies