I have created many tests for platform 4.0 and older, and I don’t understand why the same code works slower when using WPF compared to Windows Forms:
This is code, it has nothing to do with user interface elements:
Random rnd = new Random(845038); Int64 number = 0; for (int i = 0; i < 500000000; i++) { number += rnd.Next(); }
In WPF, the code accepts 5968ms - 6024ms for Windows Forms and 6953ms in WPF.
Here is a post with a downloadable solution: http://blog.bettiolo.it/2010/04/benchmark-of-net-framework-40.html
When I downloaded the zip file and looked at your code, the problem became obvious: This is not the same code.
, - # JIT-. . . .
, :
, WinForms JIT- "i" , WPF , .
, WPF WinForms: , , , -.
. , , .
Windows . , , WPF, ( ), , Winforms.
.
?
, - , 24-48 . -, . - gui-gode , , ergo, .
, , , , . WPF Winforms .
, . , WPF , , WPF.
, , , . , , .
, WPF, , .
Do you have any form showing on screen? I think the overhead for the form may be what you see.
Source: https://habr.com/ru/post/1740926/More articles:No lengthy talk - IllegalArgumentException: Stack must not be null - javaWhen is the best implementation of the I2C driver module on Linux - linux-device-driver.NET Framework 4 Client Profile and .NET Framework 3.5 Client Profile - .netDjango SMTP and secure password authentication - pythonHow to get win-win playback? In mediaplayer for android - androidMSBuild SafeImports whitelists (project files that have custom trusted MSBuild settings) - visual-studio-2008What is the best skin library for Windows Forms? - winformsIs there a place where you can find other jQuery user interface themes? - jquery-uiDebugging / running executable files in cmake / Visual Studio project - windowswpf scrollviewer scrolltoverticaloffset - wpfAll Articles