Performance when loading Diagrams

When working with the diagramming models, I am seeing performance issues when loading a number of nodes I would consider to be a small number. I am bringing content into each of the nodes and then displaying them on the diagram. However, when loading 48 nodes with content, the diagram is taking 25+ seconds to display. As my diagrams could contain 100-200 nodes, this seems to be a very low number to be seeing a performance issue. I have validated  that the time to read and load the content to the nodes is less than 2 seconds. 

I also looked into using the Virtualization setting to see if this would improve the performance. If the diagram is zoomed in to show 1-3 nodes, the load time is about 10 seconds. However, as I navigate the diagram, the solution crashes. The errors seen in the debugger are below. Note that this did not occur when I did not use Virtualization.

Any thoughts on improving the performance for my diagrams? 

Errors from debugger:

System.Windows.Data Error: 40 : BindingExpression path error: 'ShapeStyle' property not found on 'object' ''DocumentView' (HashCode=23341284)'. BindingExpression:Path=ShapeStyle; DataItem='DocumentView' (HashCode=23341284); target element is 'NodePort' (Name=''); target property is 'ShapeStyle' (type 'Style')
System.Windows.Data Error: 40 : BindingExpression path error: 'Shape' property not found on 'object' ''DocumentView' (HashCode=23341284)'. BindingExpression:Path=Shape; DataItem='DocumentView' (HashCode=23341284); target element is 'NodePort' (Name=''); target property is 'Shape' (type 'Object')
System.Windows.Data Error: 40 : BindingExpression path error: 'PortVisibility' property not found on 'object' ''DocumentView' (HashCode=23341284)'. BindingExpression:Path=PortVisibility; DataItem='DocumentView' (HashCode=23341284); target element is 'NodePort' (Name=''); target property is 'PortVisibility' (type 'PortVisibility')
System.Windows.Data Error: 40 : BindingExpression path error: 'ShapeStyle' property not found on 'object' ''DocumentView' (HashCode=23341284)'. BindingExpression:Path=ShapeStyle; DataItem='DocumentView' (HashCode=23341284); target element is 'Node' (Name=''); target property is 'ShapeStyle' (type 'Style')
System.Windows.Data Error: 40 : BindingExpression path error: 'Shape' property not found on 'object' ''DocumentView' (HashCode=23341284)'. BindingExpression:Path=Shape; DataItem='DocumentView' (HashCode=23341284); target element is 'Node' (Name=''); target property is 'Shape' (type 'Object')
An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll


4 Replies

DT Deepa Thiruppathy Syncfusion Team May 23, 2022 10:58 AM UTC

Hi Stephen ,


Reported issue: Performance issue while loading a greater number of nodes in diagram and application crash while using Virtualization


We need know below details from your side. So that we can reproduce the exact issue from our side that you are facing,


  1. Are your using DataSource and creating any layout using that DataSource or using Nodes and Connectors collection?
  2. Did you adding Nodes , Connectors at run time or adding at design time itself?
  3. Did you Outline constraints along with Virtualization?


Regards,

Deepa Thiruppathy



SS Stephen Shake May 24, 2022 11:59 PM UTC

As an initial response to the above, the issue I'm seeing is on opening an existing diagram from the xml file. I have saved the nodes and connectors along with several custom attributes. I am reloading the nodes with content through the OnItemAdded event of the diagram. I am not adjusting the layout during the opening of the file and loading of the nodes and connectors. 

Please see the answers to the questions below:

  1. Are your using DataSource and creating any layout using that DataSource or using Nodes and Connectors collection? - If you are referring to the Automatic Layout options, I am not leveraging that feature. I am using the Nodes and Connector collections

  2. Did you adding Nodes , Connectors at run time or adding at design time itself? - This is loading at run time and as mentioned above, when loading a file.
  3. Did you Outline constraints along with Virtualization? - I set the following constraints on the diagram for virtualization:



DT Deepa Thiruppathy Syncfusion Team May 25, 2022 01:02 PM UTC

We are trying to create a sample as you explained. We will share you the more details on or before May 26, 2022.



DT Deepa Thiruppathy Syncfusion Team May 26, 2022 12:53 PM UTC

Hi Stephen,


Reported issue: Performance issue when loading 200 nodes and connectors.


We have created a sample and validated the performance with 100 nodes and 150 nodes. When loading 100 nodes it takes less than 5 seconds and it takes less than 7 seconds for 150 nodes. We have loaded the pre-saved xaml file into diagram as a stream file at run time. We have content and content template for nodes and Content for nodes will be added from ItemAddedEvent during run time.


Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/PerformanceValidationSample-2108328770


We request you to load your xaml file in above sample. If you are still facing the issue, please share your xaml file with us. We will validate it from our side. If you have any confidential information in xaml file and if you are not interested to share, please explain content, and content template related details with us. We will try to add duplicate content and content template as your details. If you are not okay to share those details in the forum, We request you create a ticket using below link,


Link: Create Ticket | Syncfusion Support


Regards,

Deepa Thiruppathy


Loader.
Up arrow icon