Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
UltraTree performance issue
posted

Hello,

I 'm loading a tree in Outlook Express mode with approax 1000 folders (deepest folder level is 7) and 5000 items. It takes about 1 minute to load. I have analyzed performances with a tool, and I can see that most of time is spent in : SetCellValue and UltraTreeColumnSet.DirtySortForAssociatedNodesCollections(UltraTree) .

I have just 5 columns to set and if I remove columns sorting, result is the same. I have tested with 2007.3(hot fix 1061) and 2008.3 versions.

Is there any options to set to accelerate loading in that case ?

Thanks.

Parents
No Data
Reply
  • 60
    Verified Answer
    posted

    I too had significant performance problems when adding a large number of UltraTreeNodes.  My solution was to temporarily disable sorting before the batch node creation using a special class I built that saves and restores a tree's sort settings.  I use it like this:

            _tree.BeginUpdate();
           
            // The 2nd parameter (true) tells the class to remove the sort settings after they are saved
            TreeSortSettings sortSettings = TreeSortSettings.FromTree(_tree, true);
            try
            {
                // Add a batch of nodes
            }
            finally
            {
                sortSettings.Restore();
                _tree.EndUpdate();   
            }

     

    Using BeginUpdate()/EndUpdate() alone didn't seem to help in any noticeable way.  Before using TreeSortSettings, it would take roughly 10 seconds to add 800 nodes in my tree's BeforeExpand event handler.  After using the TreeSortSettings class, the nodes are added and shown almost instantaneously.  Sorry for the lack of solid numbers, but take my word for it - the difference is night and day.

    I've attached the C# source for the TreeSortSettings class, feel free to use it.  It certainly solved my problem!

     

    Jim

Children