Insert/REmove TreeNode performance

6 posts, 0 answers
  1. Eric
    Eric avatar
    1 posts
    Member since:
    Jun 2007

    Posted 31 Jan 2008 Link to this post

    I have a RadTreeView that can get up to 4 levels deep.  The problem I am having is that adding and removing nodes is extremely slow.  Unfortunately my current position doesnt allow me to write a batch function to insert/remove nodes in groups.  I tried using the BegingUpdate() and EndUpdate() and this helped, and by helped i mean it took my CPU utilization from 100% to 50%.  Any suggestions on how to improve this?
  2. Jordan
    Jordan avatar
    547 posts

    Posted 01 Feb 2008 Link to this post

    Hello Eric,

    In order to reproduce your case, I used the Loading Nodes example where the tree loads 50 000 nodes.
    It took just under a second to add new node to the tree after loading the 50 000 nodes.
    At the moment the more nodes you load in a RadTreeView the slower adding/removing nodes is.
    That is because the layout algorithm iterates over all the nodes in order for the new node to be displayed correctly.

    In a batch update operation the layout algorithm updates the layout of nodes only once at the end of the operation.
    That is why if you want to be able to add/remove many nodes and not sacrifice performance you have to use BeginUpdate and EndUpdate methods of RadTreeView as in the Loading Nodes example. Otherwise, as I see your case, you will most probably have performance issues if there are lots of nodes in your RadTreeView.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Vassil Petev
    Vassil Petev avatar
    1765 posts

    Posted 05 Feb 2008 Link to this post

    Hi Eric,

    Could you let us know whether our suggestion helped? Are you going to need further assistance on the matter?

    Thanks in advance.

    Sincerely yours,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  4. Leland
    Leland avatar
    7 posts
    Member since:
    Nov 2008

    Posted 17 Feb 2010 Link to this post

    I use the following code to load a treeview 

    With treeUnassigned



    .DisplayMember =



    .DataSource =

    New SelectDomains(_mintuserid).SelectUnassignedDomains




    End With


    Generating the list using the call to SelectUnassignedDomains takes 18 seconds but in processing the data source for the treeview it takes upwords of 2 minutes. Is there something other than the BeginUpdate, EndUpdate that can be implemented to increase the performance?

    I have also replaced the .DataSource with a foreach loop just populating using the nodes.add with a new node that only contains the node's display name, and it also takes a very long time to load.


  5. Victor
    Victor avatar
    1358 posts

    Posted 19 Feb 2010 Link to this post

    Hello Leland,

    Thank you for writing. Please specify how large is your data source, if it has, say 2 000 000 items, there will certainly be a noticeable delay. In our Examples application there is an example which shows RadTreeView load time for 50 000 nodes. If you are absolutely certain that the performance issue is on our side, please provide the code which causes the slow load so that I may be able to assist you further. I am looking forward to your reply.

    Kind regards,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Stefan
    Stefan avatar
    2911 posts

    Posted 21 Mar 2011 Link to this post

    Hi Eric,

    Please note that in Q1 2011 we have introduced a major upgrade of RadTreeView control, which is now virtualized and fully customizable. Feel free to download the latest release and try it out. For more information on our latest release refer to this blog post.

    Best wishes,
    the Telerik team
Back to Top