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

Hybrid load on demand

5 Answers 75 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Bill Alexander
Top achievements
Rank 1
Bill Alexander asked on 21 Aug 2008, 12:36 AM
Our tree implementation may have a very large number of nodes, which are hierarchically grouped and some nodes may appear under multiple branches.

We use various functions to add logic to the tree and nodes, such as checking off child nodes, unchecking parent nodes, and checking all instances of a node under other branches.

These routines are very quick in FireFox, but alarmingly slow in IE.  As an example, checking child nodes takes around 40ms in FF, but takes almost 4.5 seconds in IE with about 800 nodes in the tree.

I've already applied every best practice I could find to try to trim these times down in IE, but I don't think I'll be able to make a meaningful impact at this point.

The tree is used for selections, but also keeps "state" of what is selected which is used as input for a separate AJAX call.  The selected nodes are persisted between sessions.  For this reason, normal load on demand wouldn't work as I need selected nodes to be there on the client for the client logic to work.

What I'm wondering is this.  Can I bind the tree in such a way that any nodes which I know are selected will be bound and rendered, but of the remaining nodes, only the 1st level nodes will bind.  These unselected first level nodes would then use load on demand to bind the children, making them available to select on the client.

I'm hoping that this "hybrid" implementation will greatly reduce the number of actual nodes in the tree, while still behaving similarly to the current implementation. 

Thanks.

5 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 21 Aug 2008, 10:55 AM
Hi Bill,

The slow rendering under IE will be fixed with the next release of the control. For details on the matter please refer to this blog post.

All the best,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bill Alexander
Top achievements
Rank 1
answered on 21 Aug 2008, 12:04 PM
Thanks for the reply.  To be clear, while improving tree rendering performance is certainly desirable, the performance issue I'm having is more to do with enumerating the node collections and accessing the checkbox elements on the client.

The blog post is certainly promising, but I'm not sure how to apply that technique in a way that I still have access to the client-side object model. 

Also, can you clarify when the next release is expected so I can plan accordingly?

Thanks.
0
Atanas Korchev
Telerik team
answered on 25 Aug 2008, 08:00 AM
Hi Bill Alexander,

We are not sure if the improved initialization time will be of help in your case. Anyway the update including the performance optimization mentioned in the blog post will be live in the middle of this week.

You can expect further performance improvements for our Q3 2008 release which is due at the beginning of November.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bill Alexander
Top achievements
Rank 1
answered on 25 Aug 2008, 11:54 AM
I believe I've managed to isolate the problem.  In IE, calling Node.Check() or Node.UnCheck() is very slow when called from a loop.  It appears that crossing from the native JS object model to the DOM is the issue. 

In this case, each call to check/uncheck is doing a getElementById to find the checkbox.  Perhaps it would be faster if the Node object kept a direct reference to the checkbox element thereby negating the need to walk the DOM tree to find it.

At the very least, it may be possible to have the Checkbox property be late bound so at most only one lookup is necessary during the lifecycle of the tree.

Crazy talk?
0
Atanas Korchev
Telerik team
answered on 25 Aug 2008, 12:02 PM
Hello Bill Alexander,

You don't seem to be using RadTreeView for ASP.NET Ajax (from the Telerik.Web.UI.dll assembly). The Check/Uncheck methods are now check/uncheck (or set_checked(true/false)). You are probably using RadTreeView Classic which indeed has some performance issues. I strongly recommend upgrading to RadTreeView for ASP.NET Ajax to gain additional performance.

Kind regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Bill Alexander
Top achievements
Rank 1
Answers by
Paul
Telerik team
Bill Alexander
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or