Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Performance improvement for MeasureOverride (Read 2202 times)
milosa
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Mar 16th, 2017
Performance improvement for MeasureOverride
Jul 2nd, 2018 at 10:55am
Print Post  
Hello,

I am trying to improve loading time for bigger diagrams in my project.

When I do profiling I can see that 30% of the time is spent in the Mindfusion.Diagramming.Wpf.Diagram.MeasureOverride(size).
Since I don't know the details of this method, I was wandering is there something that I am doing wrong since this method takes big share of the time?

Is there something that I could do to make it trigger less often? (precalculate the size, add more nodes at once...)?

Any idea is greatly appreciated.

Regards,
Milos
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3447
Joined: Oct 19th, 2005
Re: Performance improvement for MeasureOverride
Reply #1 - Jul 3rd, 2018 at 9:26am
Print Post  
Hi,

It just calls Measure method on child elements (so all diagram items), as we believe this is required by WPF for proper rendering. You could try overriding the method in a custom diagram class and skip calling base.MeasureOverride in some situations (e.g. if some flag you set in Created/Modified/Deleted events is false), but this could leave the WPF visual tree in invalid state, not detecting clicks, clipping items, etc.

If by chance you keep a lot of diagram items hidden, you can set RemoveHiddenItemsFromVisualTree property to keep the WPF visual tree smaller, which will lead to shorter loops in Measure methods.

Check these older posts for other performance discussions -
https://mindfusion.eu/Forum/YaBB.pl?num=1491554817
https://mindfusion.eu/Forum/YaBB.pl?num=1504143892
https://mindfusion.eu/Forum/YaBB.pl?num=1442997646
https://mindfusion.eu/Forum/YaBB.pl?num=1268995278
https://mindfusion.eu/Forum/YaBB.pl?num=1358507496

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint