Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does WPF optimise the layout / rendering cycle?

How does WPF optimize the Layout / Rendering cycle in a highly volatile application?

For example, imagine I invalidate a custom control twice in quick succession, will it render twice? Are there performance issues when Data/Property update-rates are faster than main render rate?

like image 635
Meirion Hughes Avatar asked Mar 21 '13 14:03

Meirion Hughes


People also ask

Is WPF GPU accelerated?

The WPF system defines three rendering tiers: Rendering Tier 0 No graphics hardware acceleration. All graphics features use software acceleration. The DirectX version level is less than version 9.0.

Why is WPF application slow in performance?

While WPF is over a decade old and has been improved greatly over the years, there are still several areas that can suffer from poor performance. The reasons for this poor performance include things such as bad coding practices, broken bindings, complex layouts, the lack of UI virtualization, and much more.


1 Answers

Based on my experience, I can say that no it will no render twice if it's fast enought. I'm not 100% sure, but this is why i think this:

We had a really heavy application (thousands of controls), it was an aircraft cockpit, all in wpf, each button, switch, screen were movable by gesture, or mouse.

The cockpit was 10 000 pixels by 10 000 pixels, and implemented a Zoom in/Zoom out (with mouse wheel), panning when right mouse button clicked.

Before optimization, it was very laggy, slow, so each "Zoom" step, or "Pan" step took about 1 second

If I Zoom 1 time (Zoom * 1.2 for example), it took 1 second

If I Zoom 10 times (Zoom * 1.2 X 10), it does not takes 10 seconds, it takes probably like 2 seconds depending on the speed you scroll, and it does not render each "zoom step" it render only the last one...

like image 65
mlemay Avatar answered Oct 05 '22 12:10

mlemay