Copied to clipboard

Flag this post as spam?

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


  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Aug 18, 2010 @ 15:51
    Jeroen Breuer
    0

    Linq to Umbraco slow?

    Hello,

    I've got the following code:

    var test =
                        (
                            from testNode in home.Children
                            select testNode
                        ).ToList();

    This code seems to be pretty slow. My home node has multiple document types as children and I want to fetch them all. Is there a faster way to do this?

    Jeroen

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Aug 18, 2010 @ 15:54
    Jeroen Breuer
    0

    Can't edit my post so I'll reply....

    If I try to fetch all the child nodes of a single document type it seems much faster. Is it slow because it needs to fetch children from multiple document types?

    Jeroen

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Aug 19, 2010 @ 00:39
    Aaron Powell
    0

    That should perform exactly the same as if you're getting the children of a particular type, IIRC it creates all of the children on the enumeration of the Children property or the OfType style property.

    The only difference is that there is a filter added to the OfType version.

    How many child nodes are there of the home object?

    What kind of performance difference are you seeing?

Please Sign in or register to post replies

Write your reply to:

Draft