microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.36k stars 678 forks source link

Input performance regression between WinUI 2 and 3 #6750

Open lhecker opened 2 years ago

lhecker commented 2 years ago

Describe the bug

The CPU overhead of input appears to be approximately 2-6x higher with WinUI 3 compared to WinUI 2. (Sometimes >100x higher in case of a blinking cursor, which is really a tad bit too much for a cursor.)

This is most noticeable during cursor movements inside a WinUI 3 app. These cause it to continuously use ~80% of one of my CPU cores while not actively drawing anything. We should fix that to improve our user's battery life. 💪

Steps to reproduce the bug

For a comparison do the same in either of these:

Expected behavior

The CPU usage during cursor movements should be the same. Optimally the CPU usage should be on par with a ComCtl or WPF one (e.g. regedit/SizeBench), which is approx. 10x less.

Screenshots

While moving my cursor inside the WinUI 3 Controls Gallery: image

This is on a 32 core machine. 3.125 in the "CPU" column would equate to 100% usage of a single CPU core. I made sure that the FPS of the application remains at 0 (i.e. no actually expensive work being done).

NuGet package version

WinUI 3 - Windows App SDK 1.0

Windows app type

Device form factor

Desktop

Windows version

Insider Build (22559)

Additional context

No response

StephenLPeters commented 2 years ago

@codendone FYI

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

lhecker commented 1 year ago

What if I comment here... Is that considered activity? 😅