Impact of LayoutTransform vs RenderTransform performance?

I dealt with LayoutTransform and RenderTransform, and I know that each of them is suitable for a specific scenario, which I found in previous projects.

However, in terms of performance and when using the WPF profiling tool for an instance, which one has less impact on UI performance?

+7
source share
2 answers

As indicated by MSDN:

To apply transformations to a FrameworkElement element, create a Transform and apply it to one of the two properties that the FrameworkElement class provides: LayoutTransform - the transformation that is applied before passing the layout. After applying the transform, the layout system processes the converted size and position of the element. RenderTransform - a transformation that changes the appearance of an element, but is applied after the completion of the layout. Using the RenderTransform property instead of the LayoutTransform property, you can get performance benefits. What property should you use? Due to the performance benefits it provides, use the RenderTransform property whenever possible, especially when you use Transform animated objects. Use the LayoutTransform property when scaling, rotating, or skewing, and you need the parent of this element to adapt to the transformed size of the element. Note that when they are used with the LayoutTransform property, TranslateTransform objects do not seem to affect the elements. This is because the layout system returns the translated item to its original position as part of its processing.

And also:

LayoutTransform can lead to poor application performance if you invoke it in a script that does not require the system to completely go through the layout. When you apply LayoutTransform to the Children Panel collection, it starts a new pass with the layout system and causes all display objects to be re-evaluated and reordered. If you are updating the full application user interface (UI), this feature may be exactly what you need. However, if you do not need a full layout pass, use the RenderTransform property, which does not call the layout system, and therefore is usually the best choice for this scenario.

+10
source

To add gliderkite to the request, RenderTransforms will also be processed by the GPU when it is capable, while LayoutTransforms will be executed on the processor.

+12
source

All Articles