Copied to clipboard

Flag this post as spam?

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


  • Kim Hansen 63 posts 144 karma points
    Feb 04, 2012 @ 21:29
    Kim Hansen
    0

    Performance issue +5000 nodes

    Hi there

    Ive got a performance issue, when trying to select the newest 20 nodes from a news list of more than 5000 items.

    What is best practice when selecting from a large amount of items?

    My tree is as follows:

    NewsList

    --Year

    ----Month

    ------NewsItem

     

    The best result so far, has been a clean select that is select="$newsList/Year/Month/NewsItem" with a sort select umbraco.library:FormatDateTime(@createDate, 'yyyyMMddhhmm') and then a position()<21

    But it gives me a renderingtime of 0.7 seconds, which is far too much for my serveradmin to appeciate.

    Thanks for any help given :)

    /Kim

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 04, 2012 @ 22:19
    Jan Skovgaard
    0

    Hi Kim

    What does the full xslt code look like right now?

    /Jan

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Feb 04, 2012 @ 22:49
    Chriztian Steinmeier
    0

    Hi Kim,

    One thing you should do is to skip the library function - @createDate IS already sortable as it is, so a plain <xsl:sort select="@createDate" /> will do just fine. That might shave off a point or two...?

    Since you're already using year/month folders, maybe selecting only nodes from current and previous year would be sufficient already? That should bring it down quite a pair of notches too, I'd say.

    /Chriztian

  • Kim Hansen 63 posts 144 karma points
    Feb 05, 2012 @ 00:41
    Kim Hansen
    0

    Hi there fellow danes :)

    My mood has just gone up by 100%

    The createDate solution gave me next to nothing, but the other one is a hole other story :)

    The rendering time just went from 0.7 sec to 0.02 by selecting from this year only.

    I tried to render using news from 2011, and the rendering time were 0.05 secs.

    But i think ill change it up a bit, and select from the last 2 months, so i dont run in to any problems in the beginning of 2013.

    <xsl:variable name="currentYear" select="umbraco.library:FormatDateTime(umbraco.library:CurrentDate(), 'yyyy')"/>
                    <xsl:for-each select="$newsList/Year[@nodeName=$currentYear]/Month/NewsItem">
                      <xsl:sort select="@createDate" order="descending"/>
                      <xsl:if test="position()&lt;21">

                      Blah..

                      </xsl:if>
                    </xsl:for-each>

  • Kim Hansen 63 posts 144 karma points
    Feb 05, 2012 @ 00:53
    Kim Hansen
    0

    Jan, you probably know the project.

    Kim Sørensen has been working on it for a while now :)

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 05, 2012 @ 10:59
    Jan Skovgaard
    0

    Hi Kim

    hmm, if you by "Kim Sørensen" actually mean "Kim Andersen", then yes :)

    /Jan

  • Kim Hansen 63 posts 144 karma points
    Feb 05, 2012 @ 18:01
    Kim Hansen
    0

    Weeeell, 50% right :)

Please Sign in or register to post replies

Write your reply to:

Draft