4 Replies Latest reply on Aug 2, 2007 6:15 AM by kewldude

    big rich:tree : big delay

    Orsier Adrien Newbie

      Hello.

      I'm currently using a rich:tree to display some 'Topics'.
      Everything is working fine and nicely, except that I'm having over than 12,000 topics in my database.
      When I expand my 'root topic', which contain them all, it takes up to 35seconds to display them, with a "A script on the page may be busy, or it may have stopped responding. You can stop the script nor, or you can continue, to se if the script will continue" message in the middle of the processing. The direct children of 'root' are 'only' about 700.

      Then, when I'm clicking to expand one of my nodes, I takes about 5 seconds to display its children, and 5 seconds to 'unexpand' them. My tree switch_type is ajax, since in client mode the browser can simply not load the tree.

      Here's some simple code about it, although there's nothing special in it:

      <rich:tree switchType="ajax" style="width:300px" value="#{arbre.data}" var="item" nodeFace="#{item.type}">
       <rich:treeNode type="topic">
       <a4j:commandLink action="#{topicManager.selectItem(item)}" reRender="bookList,selectedTopic">#{item.keycode} : #{item.name} - </a4j:commandLink>
       </rich:treeNode>
       </rich:tree>

      Note again that everything is working fine, except that it's working far too slowly.

      I'd just wanna know on what I could work to improve that.
      The main problem is that each ajax method to expand a node takes about 5seconds server-wise to process. It's really slow when you wanna expand a node with just one child.
      There's also the problem of the displaying of the first 700 nodes, which take about 35s, but it seems to be a client-side problem, dunno if there's much to do about it.


      Oh and about my code implementation, each topic owns a Map of topics (its children) and has its 'father topic' reference.

        • 1. Re: big rich:tree : big delay
          Orsier Adrien Newbie

          Oh and sorry for the french in the code, arbre is my 'tree' class, which is used to generate the tree.

          • 2. Re: big rich:tree : big delay
            Luiz Gustavo Newbie

            Hi,

            I'm facing the same problem.
            I found in the forum that trees can't support more than 500 nodes (a big problem), so that's the reason for the: "A script on the page may be busy, or it may have stopped responding. You can stop the script nor, or you can continue, to se if the script will continue" message.

            Is there anybody that can help us?

            • 3. Re: big rich:tree : big delay
              Igor Shabalov Apprentice

              I wonder how it display 12000 nodes at all.

              This is major limitation of dhtml - it become slow on big numbers. Tree is rendered into table. Tables are very heavy load for browser rendering, especially when there are too many of tables on the page.

              I'd rather not use dhtml to handle such situation. We are trying to come up with some approach for such case in our (upcoming) Scrollable Data Table, when we control scrolling and try to load on-the-fly limited sub-set of rows (what fit to the screen)

              I cannot imagine the user who can read 12000 topics at once :-)

              • 4. Re: big rich:tree : big delay
                kewldude Newbie

                I've read in the myfaces list that in this kind of situation lazy loading is applied for rendering tree nodes, has anyone tried that approach with the richfaces tree?