question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Severe performance issues in WinUI 3

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
jeremy-visionaidcommented, Feb 9, 2023

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…

1reaction
bpulliamcommented, Apr 18, 2023

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WinUI 3 Performance Boost
In this blog post, we will describe performance challenges we've encountered ... Dependency property is much slower in WinUI 3 than in WPF....
Read more >
Is WinUI really production ready? : r/dotnet
Yes. The main bottleneck of WinUI3 is its performance issues in my opinion. WinUI 3 is used by every MAUI app and I...
Read more >
WinUI 3, what's the nonsense?
... running legacy programs in Widows 10X appears to have severe performance problems at the moment. ... About WinUI (microsoft.github.io).
Read more >
Performance Guidance for Application Virtualization 5.0
Learn how to configure App-V 5.0 for optimal performance, optimize virtual app packages, and provide a better user experience with RDS and ...
Read more >
Performance improvement on rendering - WinUi 3
I am working on .Net MAUI and new to native rendering. I am trying to render a line with stroke width based on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found