Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Large number of nodes (Read 1591 times)
JC
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Feb 5th, 2009
Large number of nodes
Feb 5th, 2009 at 11:27pm
Print Post  
Hello All,

I'm researching some components I might need for an upcoming project and, never having worked with flowchart.net,  I have a question for the experts here. 

* My project might require the ability to load a hierarchy type data set with up to 50k (simple)nodes.  Can Flowchart.net handle that type of node count with reasonable performance?

Thanks!

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Large number of nodes
Reply #1 - Feb 6th, 2009 at 9:07am
Print Post  
Hi,

Here is some code you could play with:

Code
Select All
Diagram diag = new Diagram();
diag.ValidityChecks = false;
diag.DefaultShape = Shapes.Rectangle;

DateTime start = DateTime.Now;
for (int i = 0; i < 50000; ++i)
	diag.Factory.CreateShapeNode(10, i*40, 30, 30);
MessageBox.Show("nodes created for: " + (DateTime.Now - start).ToString());

start = DateTime.Now;
for (int i = 1; i < 50000; ++i)
	diag.Factory.CreateDiagramLink(diag.Nodes[i], diag.Nodes[i / 1000]);
MessageBox.Show("links created for: " + (DateTime.Now - start).ToString());

diagramView1.Diagram = diag;
 



Creating the 50000 nodes takes about 5 seconds on my system, and creating the 50000 links takes 15 seconds.

It's important that the diagram is not attached to a view while creating the items, or otherwise that would trigger many repaint events and slow down the Create calls a lot.

Note that creation time depends much on the structure of the graph. E.g. in my test if all 50000 links were connected to diag.Nodes[0], it took about two minutes. Seems it's a lot faster to update the link collections of size up to 1000 links for 50 nodes, than updating a single node's links collection with a size of 50000 links.

You might consider delay-loading your items, e.g. by showing only the first two levels of your hierarchy as Expandable nodes, and then create additional child nodes in response to the ExpandBtnClicked event.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
JC
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Feb 5th, 2009
Re: Large number of nodes
Reply #2 - Feb 6th, 2009 at 4:25pm
Print Post  
Thank you for your quick response Stoyan. 

I expect that each of the 50,000 nodes will have anywhere from 1-100 links so lazy loading may be my only option for large data sets.

I'll give the code above a whirl to see how the number of nodes and links per node can affect performance then try to optimize from there.

- JC



  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint