We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

[DIAGRAM} FilledPath.CentralPort.Disconnect and Connect takes up to 250 ms each

I have a one time update code similar to this: 

            var shapes = this.diagram1.Model.Nodes.OfType<FilledPath>();
            foreach (FilledPath shape in shapes)
                foreach (ConnectorBase connector in shape.EdgesLeaving.OfType<ConnectorBase>())
                {
                    shape.CentralPort.Disconnect(connector.TailEndPoint);
                    shape.CentralPort.Connect(connector.TailEndPoint);
                }

            foreach (FilledPath shape in shapes)
                foreach (ConnectorBase connector in shape.EdgesEntering.OfType<ConnectorBase>())
                {
                    shape.CentralPort.Disconnect(connector.HeadEndPoint);
                    shape.CentralPort.Connect(connector.HeadEndPoint);
                }

Each connect and disconnect can take up to 250ms, taking one minute for all the FilledPath, calling the Garbage Collection on each connect or disconnect.

Can I speed up the process in some way?



Best regards

Marco



3 Replies

NG Naganathan Ganesh Babu Syncfusion Team February 14, 2017 09:31 AM UTC

Hi Marco, 
 
Thanks for contacting Syncfusion support. 
 
On further analysis, the connect/disconnect method taking 40ms for each connector. Please refer to the below video for your reference.  
 
Video: 
 
 
We have checked your requirement only in our latest version of Syncfusion Diagram control and it contains only one connector established with the connection. So, could you please share us the following information, 
1.     Number of nodes and connectors available in the sample, 
2.     The version you are using in which the reported problem occurs, 
3.     Your sample. 
Which will help us to analyze further and provide you a better solution.  
 
Regards, 
 
Naganathan K G 
 



MC Marco Casella February 14, 2017 04:51 PM UTC

The diagram was around 50 (derived) shapes and 50 links.
With this number of elements disconnecting or connecting a link takes long time, launch garbage collection on every call and a large amount of memory (sometimes throws an OutOfMemory exception after 200 call).

BTW, I have resolved by pausing some Diagram service:

https://www.syncfusion.com/kb/5702/improving-the-performance-of-the-diagram-while-selecting-and-moving-the-lots-of-nodes



best regards
Marco


NG Naganathan Ganesh Babu Syncfusion Team February 17, 2017 06:10 AM UTC

Hi Marco, 
  
We have updated the response in incident which is created by you for the same query. Please follow-up with that incident for furthers details.  
  
  
Regards, 
  
Naganathan K G 
 


Loader.
Live Chat Icon For mobile
Up arrow icon