Severe performance issues in WinUI 3
See original GitHub issueDescribe the bug
Getting some brutal performance issues in all versions of WinUI 3, including the latest 1.0 Preview 1. Running the following on CompositionTarget.Rendering with a completely empty window consistently yields results between 29 and 31ms:
PerformanceCounter.Stop(); //PerformanceCounter is an instance of class Stopwatch
Console.WriteLine(PerformanceCounter.Elapsed.TotalMilliseconds + "ms");
PerformanceCounter.Restart();
For comparison, if I do exactly the same in UWP XAML I get results in the ballpark of 0.5ms - that’s 60 times faster than WinUI 3, which’s current framerate (equivalent to ~33fps) is not acceptable even for a desktop UI.
Steps to reproduce the bug
public App()
{
InitializeComponent();
CompositionTarget.Rendering += PerformanceTest;
}
private Stopwatch PerformanceCounter = new();
private void PerformanceTest(object Sender, object Event)
{
PerformanceCounter.Stop();
Console.WriteLine(PerformanceCounter.Elapsed.TotalMilliseconds + "ms");
PerformanceCounter.Restart();
}
Expected behavior
At minimum, I expect the average user’s PC to produce at least 60fps (16.6ms) in an empty window, ideally being able to match any common refresh rate. As shown by the tests above, a PC with considerably above-average specifications produces framerates that are well below what the average user that would consider acceptable.
Screenshots
No response
NuGet package version
No response
Windows app type
- UWP
- Win32
Device form factor
Desktop
Windows version
Insider Build (22000.194)
Additional context
Tested on a machine with the following specs: OS: Windows 11 Pro (22000.194) GPU: NVIDIA GeForce GTX 1080ti CPU: AMD Ryzen 5 2600 RAM: 2x8GB DDR4, 3000MHz
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:5 (2 by maintainers)
Top GitHub Comments
Well over a year now, and WinUI 3 rendering perf is still too slow to consider it being usable for certain classes of application 😦 Really wish it were open source so the community could fix it themselves…
A fix for the core issue is included in the 1.3 release, released April 12th. If you are still seeing low framerates on high refresh monitors using 1.3, please log a new issue, as it is likely a different scenario and we should track it separately.