I am having a performance problem involving grouping large sets of nodes/links into subgraphs. I use the code from your subgraph example in my program. The entire time in issue is spent in the subgraph.addcollection routine. If I keep the number of nodes/links in the subgraph in the low thousands the performance is reasonable. But as I try larger datasets of nodes such as 85000 nodes/140000 links the amount of time to group seems to be exponential. I let it run over 8 hours without completing on some sets. If I do not group the nodes it takes under one minute to load any of these large sets.
Can you give me some numbers for the number of subgraphs, the depth of subgraphs within subgraphs, number of nodes per subgraph, how much links cross subgraphs, etc?
What node class? GoLink or GoLabeledLink?
Can you post or email your code for constructing the hierarchy?
A quick test with 10,000 subgraphs with 4 GoSimpleNodes and 1 link per subgraph: create + display time of about 20 seconds on a 3 year old laptop.
Update: new test. changed “doc.gif” icon to GoRectangle. 10,000 subgraphs with 100 nodes each. (no links… so a major missing piece there). But I’m creating and displaying 100,000 nodes in about 35 seconds.
something to look at: how heavyweight are your derived node classes? If you swap out your node class for a GoSimpleNode, do the times improve? What if you don’t create links?
I use GoIconic nodes and GoLink links. I do use classes based on your classes with added variables but they are not that extensive. I can not post the code since I work in a classified environment.
It would sure help if I could reproduce what you’re seeing.
ok… try these things.
replace your node’s icon with a rectangle.
GoRectangle rect = new GoRectangle();
rect.Size = new SizeF(15, 15); // or whatever size makes sense to you
and (if you can) comment out the link creation. Let’s see if the problem exists just with very simple nodes.
If I switch to very large numbers of children in the subgraphs, I’m starting to see what you are. Let me spend some time investigating.
I’ve emailed you some code to try.
The code worked and it is fast now. Almost the same as without grouping. I really appreciate the prompt support. This was the last big performance issue I had and now I am really excited about my next release with all the speed improvements.