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.
Hi,
i have found this performance problem too - UltraTree is getting very slow adding new nodes IF you do something with the node inside the loop.
Let me explain this with a short example:
Example 1: This one is running very fast (<1 Second)
private void button1_Click(object sender, EventArgs e) { UltraTreeNode node; Cursor.Current = Cursors.WaitCursor; treeBrowser.BeginUpdate(); for (int i = 0; i <= 8000; i++) { node = treeBrowser.Nodes.Add("entry: " + i.ToString()); } treeBrowser.EndUpdate(); Cursor.Current = Cursors.Default; }
But: If you do it different it is getting very slow (6+ Seconds for the same Job!):
private void button1_Click(object sender, EventArgs e) { UltraTreeNode node; Cursor.Current = Cursors.WaitCursor; treeBrowser.BeginUpdate(); for (int i = 0; i <= 8000; i++) { node = treeBrowser.Nodes.Add(); node.Text= "entry: " + i.ToString(); //this is making the thing slow! } treeBrowser.EndUpdate(); Cursor.Current = Cursors.Default; }
It doesn't matter if you try to set the .Text or the .Key - it's getting really slow :(
I've tried the class that was posted above to reset the SortSettings but with no success (it's not getting faster)
Well - i have to add about 8000 entries in one case... and about 25.000 in another case (i know it's stupid to have such amount of data at once but that's not my decision). The thing is, that it take only <1 to add such many nodes as long as i don't do anything with them. But of course i need to set a key, a tag, an icon etc... and if i do this, suddenly it takes 6-8 Seconds for the 8000 nodes and 60+ Seconds for the 25.000 entries :(
This is way too slow for my application and i'm happy if someone has a good solution for this.
Thanks a lot
One solution might be to assign the node's property values before adding it to the collection. Another would be to add the nodes to a List<UltraTreeNode> in the loop, then use UltraTree.Nodes.AddRange(List<UltraTreeNode>.ToArray()) to populate the nodes in one atomic operation.