Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram Display Performance (Read 1760 times)
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Diagram Display Performance
Sep 2nd, 2008 at 3:53pm
Print Post  
Hi

I populate a diagram that at the time of building, is not visible as it is on an inactive tab control tab.
The diagram is built by firing events from a dedicated thread via the diagrams dispatcher (each fired event adds a node to the diagram, sets its properties and connects to the previous). When the last node has been added, the diagram is resized with a border of 20 and the tree layout has it's arrange method fired.
This process completes with out issues, generally fairly quickly, depending on the size of the diagram of course (15 seconds in our smaller diagrams with 100s of nodes). When the tab holding the diagram is clicked on it takes considerably longer to actually draw / render the diagram as if the actions of the fired events were merely queued by the diagram control and only drawn when the diagram displays. Is this an accurate assumption?

On a significantly larger diagram which took 28 seconds for the events to complete, the following exception occurred during display / render:

ContextSwitchDeadlock was detected
Message: The CLR has been unable to transition from COM context 0x45efa8 to COM context 0x45f118 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram Display Performance
Reply #1 - Sep 3rd, 2008 at 7:09am
Print Post  
Hi,

I think what happens when you activate the tab is that the WPF measure and arrange passes are executed, the diagram creates the visual tree, which then WPF renders using DirectX. Rendering 100s of ShapeNodes should not be a problem - they just add some Path and Glyph objects to the visual tree. Rendering TableNodes or complex custom nodes might take more time. Those 60 seconds look like some default timeout value. You might try specifying a larger value to the thread synchronization methods you are using if they provide overloads that take a timeout argument.

If you are using the alignment grid, you might check how it would work with ShowGrid = false; we have recently discovered that rendering grid points in very large diagrams takes a lot of time, but we'll optimize this in next releases.

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