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

RadTreeView performance

4 Answers 113 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Lauren Nickerson
Top achievements
Rank 1
Lauren Nickerson asked on 13 Aug 2010, 01:02 AM
Hello. I'm concerned about the performance of the RadTreeView. I created a simplistic project where I create 1001 items, one root item with 1000 sub items and the RadTreeView's size is 24.84 MB, so I thought something must be wrong because I'm just putting strings in the RadTreeViewItems, so I checked with a memory profiler, and I found out that a lot of very heavy objects are created. The ones that jump out the most are these three:

55,308x EffectiveValueEntry[] (4.69MB)
9,011x Rectangle (2.52MB)
8,019x Grid (2.17MB)

Now, this is in a simplistic problem. In our real project these numbers are much bigger (also with around 1000 items). The number of rectangles goes up to 17,000 when we display the RadTreeView and it has become a major issue for us because it uses a lot of memory. Just by displaying our tree, which is very complex, the memory usage goes up 76mb and we have two of them so that makes 152mb for both trees. We're now working in just using one tree, but 76mb is still a lot of memory of the one tree.

Here's a video I captured while making sure the items are coming from the RadTreeView:

http://www.screencast.com/users/CarloToribio/folders/Jing/media/88771fe2-84b6-4ad3-92c3-2a6f31bc32c6

Let me know if there's anything we can do, and also minimizing GUI loses.

Thanks. By the way we're using the 2009.3.1208.35 RadTreeViewItem version.

Let me know. Thank you.

4 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 17 Aug 2010, 11:13 AM
Hi Lauren Nickerson,

In the RadTreeViewItems CotnrolTemplate there are many elements that may not be needed in your case - for example the visuals of a CheckBox, RadioButton, horizontal and vertical line. They can be further decreased if you are not using any border brushes.

The EffectiveValueEntry[] is an object that holds the local/effective values of a DependencyObject, so they should roughly equal the number of dependency objects. Their size will decrease as the application is optimized.

9,011 rectangles means that there ~9 rectangles for each TreeViewItem. With a custom template we can probably get them down to 1 or 2;

The best improvement in this case will be to databind the TreeView and use hierarchical virtualization. This means that only containers (TreeViewITems) for the visible items will be created and the size of the tree will not be very much dependent on the number of items.

All the best,
Miroslav
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
0
Lauren Nickerson
Top achievements
Rank 1
answered on 17 Aug 2010, 06:24 PM
Thanks for the answer.

We were thinking about implementing our own template but we don't really want to waste time on that. We did opt for virtualization but we found a really bad problem with the scroll bar (see this forum thread) the scrollbar changes size as the items are created, so we're probably stepping away from virtualization if we don't find a solution for that too. I guess in the source code there's the template for the RadTreeViewItem, maybe I can grab that and simplify it to fit our needs and use less memory?
0
Lauren Nickerson
Top achievements
Rank 1
answered on 19 Aug 2010, 09:49 PM
I'm looking for the RadTreeViewItem template so I can simplify it by removing some visuals, but I can't seem to find it in the source code. Would you mind pinpointing me to where it is?

Thanks!
0
Miro Miroslavov
Telerik team
answered on 20 Aug 2010, 12:00 PM
Hi Lauren Nickerson,

I'm attaching the ControlTemplates and Styles for the RadTreeView and RadTreeViewItem. You can get it and remove the visuals that you don't need.  (Just change the Style of your TreeView with one that overides the Template proeprty).
If you need further assistance, please contact us.


All the best,
Miro Miroslavov
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
Tags
TreeView
Asked by
Lauren Nickerson
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Lauren Nickerson
Top achievements
Rank 1
Miro Miroslavov
Telerik team
Share this question
or