What type of application starts faster: Windows Forms or WPF?

As far as I know, WPF applications should run faster than Windows Forms applications because WPF applications use DirectX to render instead of GDI. But which application will start working faster: WPF or Windows Forms? Will the start time be about the same or will one type of application be significantly faster than the other?

I am not targeting any particular operating system.

+7
source share
3 answers

Just to point out, in my experience, WPF rendering is actually quite slow than Windows Forms, despite using DirectX. This is due to the fact that a lot of tessellation and layout calculations are performed on the processor side, which actually cancels the performance gain when using the GPU.

Just go to Google for “WPF Slow” or “WPF Performance,” and you'll find how awful developers are shocked to find out how much time and effort they spent converting WinForms to WPF because the rotation around the GPUs was wasted since The result is slower than the original application.

However ... I will say that. WPF is far superior to WindowsForms in terms of styles, graphics, developer productivity (data binding), animation, appearance, etc. If performance is really a problem, you can optimize in certain areas. For example, did you know that you can get an API for writing directly to a bitmap in WPF (see the WriteableBitmap class) to perform operations like GDI in memory? This is (surprisingly) about 20 times faster than the WPF primitives for some operations.

Similarly, you can use virtualization to improve the performance of datagrids, etc. Telerik has an example of its grid scrolling 1,000,000 lines in interactive frames.

In conclusion, think about what you are doing and see similar examples on the Internet. Are you doing real-time data collection and visualization or just a standard line of business applications? Comparison of such examples to understand what the structure is capable of will help you in your decision.

2013 Q3 Update

As an update, in various projects, I now see faster and faster WPF performance by moving anything and everything from the user interface stream. For example. Leave the UI thread for the UI only, do as much work as possible using the parallel task library or RX. Make everything asynchronous and do not block the UI thread while waiting.

Repair binding errors as they contribute to WPF performance issues.

You can move animations (for example, wait or load animations) to another stream for animation without glitches. You can use render-to-bitmap when performing animated transitions.

Short story? You can get great performance from WPF applications (as well as using the smoothing user interface), but you need to add a bit more work!

+3
source

I think the start time will be about the same. I recently created several WPF applications, and in some cases I think the initial load time is a bit slower than the win forms, but this is not much, and WPF is more than it does for it when the application is up and running

+2
source

In my experience, I think WPF is quite real in the beginning compared to winforms. However, this question is complex, especially considering that WPF may contain another and vice versa.

I would adhere to the philosophy of this article: http://joshsmithonwpf.wordpress.com/2007/09/05/wpf-vs-windows-forms/

WPF and Winforms are not the same tool, and none of them should replace another;)

There are many duplicates in this forum, please check here link and discussion and that’s it: WPF and Windows Forms

0
source

All Articles