Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Wpf.Diagram.MeasureOverride(size) takes a lot of time to execute (Read 2234 times)
Kim Lillås
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 26
Joined: Aug 18th, 2016
Wpf.Diagram.MeasureOverride(size) takes a lot of time to execute
Jan 4th, 2019 at 1:56pm
Print Post  
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
  

MeasureOverride.png ( 4 KB | 126 Downloads )
MeasureOverride.png
Back to top
 
IP Logged
 
Kim Lillås
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 26
Joined: Aug 18th, 2016
Re: Wpf.Diagram.MeasureOverride(size) takes a lot of time to execute
Reply #1 - Jan 4th, 2019 at 2:51pm
Print Post  
Hmm, no matter, I found this in the forum:
https://mindfusion.eu/Forum/YaBB.pl?num=1530528922
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3148
Joined: Oct 19th, 2005
Re: Wpf.Diagram.MeasureOverride(size) takes a lot of time to execute
Reply #2 - Jan 5th, 2019 at 10:04am
Print Post  
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
  
Back to top
 
IP Logged
 
Kim Lillås
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 26
Joined: Aug 18th, 2016
Re: Wpf.Diagram.MeasureOverride(size) takes a lot of time to execute
Reply #3 - Jan 8th, 2019 at 1:54pm
Print Post  
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
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3148
Joined: Oct 19th, 2005
Re: Wpf.Diagram.MeasureOverride(size) takes a lot of time to execute
Reply #4 - Jan 10th, 2019 at 7:38am
Print Post  
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
  
Back to top
 
IP Logged
 
Kim Lillås
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 26
Joined: Aug 18th, 2016
Re: Wpf.Diagram.MeasureOverride(size) takes a lot of time to execute
Reply #5 - Jan 11th, 2019 at 11:01am
Print Post  
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
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint