- Welcome, Guest. Please Login or Register
MindFusion  
  We have released initial version of MindFusion.Scheduling library for HTML5 & JavaScript.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
Wpf.Diagram.MeasureOverride(size) takes a lot of time to execute
Read 208 times

Kim Lillås   Offline
YaBB Newbies
*
Posts: 26
I Love MindFusion!


   
     
 
Wpf.Diagram.MeasureOverride(size) takes a lot of time to execute
Jan 4th, 2019 at 1:56pm
 
Hello,

I am in the beginnings of a CPU profiling for our application, and I notice that the MeasureOverride(Size) takes up a lot of computing power.

It is called while loading up a rather large diagram (500+ nodes and 400+ links divided into 20+ child diagrams).

When going through the stacktrace, it goes extremely deep into the System.Windows component.

Do you have any idea as to why this method would eat up so much processing power per call?

Greetings,
Kim
 
 

 
IP Logged    
 
     

Kim Lillås   Offline
YaBB Newbies
*
Posts: 26
I Love MindFusion!


   
     
 
Re: Wpf.Diagram.MeasureOverride(size) takes a lot of time to execute
Reply #1 - Jan 4th, 2019 at 2:51pm
 
Hmm, no matter, I found this in the forum:
https://mindfusion.eu/Forum/YaBB.pl?num=1530528922
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1597
Gender: male
tech.support


   
     
 
Re: Wpf.Diagram.MeasureOverride(size) takes a lot of time to execute
Reply #2 - Jan 5th, 2019 at 10:04am
 
Hi,

Adding to that, DiagramItem.MeasureOverride simply returns item.Bounds.Size by default, but if you use custom templates or DaigramNodeAdapter, it will actually delegate to the wrapped template visual / WPF element. I guess some optimization we could achieve is not calling Diagram.MeasureOverride the 8 times shown on your screenshot - but what do you mean by child diagrams and loading a diagram?

Regards,
Slavcho
Mindfusion
 
 
 
IP Logged    
 
     

Kim Lillås   Offline
YaBB Newbies
*
Posts: 26
I Love MindFusion!


   
     
 
Re: Wpf.Diagram.MeasureOverride(size) takes a lot of time to execute
Reply #3 - Jan 8th, 2019 at 1:54pm
 
Hi!

With "load" I mean that we have diagram information stored on the hard drive using our own datamodel which we load up and use as input to populate a Mindfusion Diagram component.

With "child diagrams", I mean that we have a bunch of nested diagrams in the DiagramNodeCollection Nodes of the Diagram.

Cheers,
Kim
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1597
Gender: male
tech.support


   
     
 
Re: Wpf.Diagram.MeasureOverride(size) takes a lot of time to execute
Reply #4 - Jan 10th, 2019 at 7:38am
 
Hi,

Are these nested diagrams actual Diagram instances or some kind of group / container nodes? If I create a bunch of ContainerNodes from window constructor, MeasureOverride gets called just once in my test. You could override it in custom diagram class and add a breakpoint to check what exactly triggers the multiple MeasureOverride calls in your app.

Regards,
Slavcho
 
 
 
IP Logged    
 
     

Kim Lillås   Offline
YaBB Newbies
*
Posts: 26
I Love MindFusion!


   
     
 
Re: Wpf.Diagram.MeasureOverride(size) takes a lot of time to execute
Reply #5 - Jan 11th, 2019 at 11:01am
 
Hi,

They are actual Diagram instances.

Im looking into overriding the MeasureOverride calls, and Im getting some initially promising results. I will keep looking into it to see if it leads to something stable.

Thanks for the help,
Kim
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print