This is a migrated thread and some comments may be shown as answers.

[Solved] Performance when adding a large number of nodes client side

1 Answer 99 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 20 May 2008, 07:25 PM
In the project I'm working on, we're programaticaly adding nodes client side; for the most part everything works fine, but in some extreem circumstances, we may need to load around 3000 or so nodes. The trouble with this is that eventualy IE displays a 'Stop running this Script?' dialog to the user. After looking at the code, it seems like the slowest part of the process is calling the parentNode.add(childNode) method, which takes around 20-60ms per node (the rest of the code per node only takes about 5-10ms on top of this).

Are there any tips/suggestions you could give me to improve performance here, or at least prevent that IE dialog from being displayed?

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 21 May 2008, 07:04 AM
Hello Nick,

You can try the following:
  1. If you don't need the nodes persisted to the server avoid calling trackChanges/commitChanges. This should substantially affect the performance
  2. Try to add the nodes to the treeview after child nodes have been added. Consider the following example:

    var rootNode = new Telerik.Web.UI.RadTreeNode();
    rootNode.get_nodes().add(new Telerik.Web.UI.RadTreeNode()
    treeView.get_nodes().add(rootNode);


    This would improve the rendering time of the nodes.

I hope this helps,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
Nick
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or