Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic efficiently creating diagramlinks (Read 2510 times)
deanhully
YaBB Newbies
*
Offline



Posts: 26
Joined: Aug 25th, 2008
efficiently creating diagramlinks
Jan 14th, 2009 at 12:49am
Print Post  
Stoyo,

I am creating diagrams with many nodes and diagramLinks. By far the slowest part of the process is the constructor for the diagramLink objects. I am using the ctor:
new diagramlink(diagram, origin, dest)
it is the fastest method I have found. Any suggestions for speeding up this?

Thanks,

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: efficiently creating diagramlinks
Reply #1 - Jan 14th, 2009 at 5:46am
Print Post  
If you are using link auto-routing, you should create the links after all nodes have been added. Otherwise, each added node might lead to the re-routing of several links.

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



Posts: 26
Joined: Aug 25th, 2008
Re: efficiently creating diagramlinks
Reply #2 - Jan 14th, 2009 at 2:02pm
Print Post  
No, not using auto routing. It's a pretty simple diagram just lots of nodes (~1k) and links (~20k).

At this point I am creating all the nodes first and then adding the diagram links.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: efficiently creating diagramlinks
Reply #3 - Jan 14th, 2009 at 2:10pm
Print Post  
Oh. Try that with Diagram.ValidityChecks = false.
  
Back to top
 
IP Logged
 
deanhully
YaBB Newbies
*
Offline



Posts: 26
Joined: Aug 25th, 2008
Re: efficiently creating diagramlinks
Reply #4 - Jan 14th, 2009 at 2:16pm
Print Post  
37% faster - thanks, Stoyo!

Any other magic up your sleeves?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: efficiently creating diagramlinks
Reply #5 - Jan 14th, 2009 at 2:32pm
Print Post  
Smiley Another thing you might try: create a Diagram object without displaying it inside any DiagramView, populate it, and assign it to DiagramView.Diagram only after all items have been created. This will avoid many calls to the diagramview's repaint handler.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint