Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Complex flowcharts are too slow (Read 6262 times)
sbailey
Junior Member
**
Offline



Posts: 61
Location: MD
Joined: Apr 24th, 2009
Complex flowcharts are too slow
Jul 27th, 2010 at 3:10pm
Print Post  
We've got a use case here where a ton of arrows are going out from a ton of table rows to a ton of tables, and setting up a flowchart in this state takes forever.

I've even disabled routing on the flowchart class.

Is there anything else that can be done to make AddRelation( ) not take so long?
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Complex flowcharts are too slow
Reply #1 - Jul 27th, 2010 at 3:24pm
Print Post  
Like how many of each exactly? If you are using undo/redo, you could disable it before creating all objects and only enable it after that.
  
Back to top
 
IP Logged
 
sbailey
Junior Member
**
Offline



Posts: 61
Location: MD
Joined: Apr 24th, 2009
Re: Complex flowcharts are too slow
Reply #2 - Jul 27th, 2010 at 3:31pm
Print Post  
Probably thousands of arrows. I'm not using the undo functionality, but it's possible it's still enabled.
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
sbailey
Junior Member
**
Offline



Posts: 61
Location: MD
Joined: Apr 24th, 2009
Re: Complex flowcharts are too slow
Reply #3 - Jul 27th, 2010 at 3:38pm
Print Post  
Didn't make a difference.
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Complex flowcharts are too slow
Reply #4 - Jul 27th, 2010 at 4:36pm
Print Post  
What other code is running apart from creating the objects? E.g. 500 tables and 2000 arrows were created without delay in my test, with all settings at their default values:

Code
Select All
Private Sub btnTest_Click()
	Dim i As Integer
	For i = 0 To 399
		fcx.CreateTable (i Mod 20) * 80, (i \ 20) * 160, 40, 80
	Next i
	For i = 0 To 1999
		fcx.CreateRelation fcx.tables(i Mod 400), i Mod 2, fcx.tables((i + 50) Mod 400), i Mod 2
	Next i
End Sub 

  
Back to top
 
IP Logged
 
sbailey
Junior Member
**
Offline



Posts: 61
Location: MD
Joined: Apr 24th, 2009
Re: Complex flowcharts are too slow
Reply #5 - Aug 5th, 2010 at 1:02pm
Print Post  
I'll do some diagnostics and find out. You're adding all the tables at once and then creating all the relations, which might make a significant difference. Perhaps I can queue the arrow setup.
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
sbailey
Junior Member
**
Offline



Posts: 61
Location: MD
Joined: Apr 24th, 2009
Re: Complex flowcharts are too slow
Reply #6 - Aug 5th, 2010 at 8:07pm
Print Post  
By turning off autorouting and using CreateRelation instead of the table's AddRelation function, I was able to get things to be a manageable speed. In fact, even with autorouting on, CreateRelation was significantly faster than AddRelation.
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Complex flowcharts are too slow
Reply #7 - Aug 6th, 2010 at 7:48am
Print Post  
AddRelation just checks the ERelation value and calls CreateRelation with source and destination set to the respective tables. If you got any speed improvement, it should come from the order in which items are added or from different RoutingOptions values.

Indeed adding a new table will lead to running the routing algorithm for all arrows in the vicinity, so adding the tables first before any arrows will be faster than adding the items in random order.

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