Hello WinUI Community!
Our mission is to make WinUI 3 the best native UI platform for Windows experiences and apps and performance is at the heart of that effort. Moving from WinUI 2 to WinUI 3 should always be a clear win for performance, and apps should get great results without heavy lifting.
Pavan recently shared a blog post, in which "more fluid and responsive app interactions: Reducing interaction latency by moving core Windows experiences to the WinUI3 framework" was mentioned as part of our quality commitment. Making this a reality means delivering performance improvements at multiple levels, including within WinUI itself. This also reinforces our strategic commitment to WinUI as the native framework going forward. We know that performance is just one piece of the puzzle and that there are many other areas that deserve our continued attention. Rest assured, we remain focused on those as well.
We've been zeroing in on launch time, using File Explorer and Notepad as our primary benchmarks, with an emphasis on improvements that broadly benefit most apps.
Here's what we're seeing for the WinUI portion of File Explorer launch:
| Metric | Improvement |
|---|---|
| Allocations | 41% fewer |
| Transient allocations | 63% fewer |
| Function calls | 45% fewer |
| Time spent in WinUI code | 25% reduction |
These improvements will be brought out of the development branch soon, and you will see them showing up in the winui3/main branch. We'll also be bringing these changes into WinAppSDK 2.x where possible, though some changes may be too risky or complex to deliver as servicing updates.
Some optimizations involve small or large breaking changes and will require apps to opt in. For example, we're optimizing default control styles, which should work fine for most apps but could cause issues for apps that:
SetterEach app can determine which of these changes to opt in to. Over time, perhaps as early as 3.0 or potentially in 4.0+, many of these will switch to opt-out, enabling the best possible performance by default.
Stay tuned for more updates, and thank you for being part of the WinUI community!
Glad to see WinUI 3 is not forgotten. Question, those reductions from the File Explorer launch that you measured - how much do they impact the launch itself? I assume it's not a ~40% reduction in launch time. Could you tell us, @beth-panx?
2 replies
These measurements are from the WinUI portion of the FE launch. The approach here is we do what we can from framework side, and obv other teams in Windows also investigated and been doing work to improve overall launch perf, we connect/collaborate frequently to make sure the improvements will be end-to-end. It's a long-term commitment for fundamentals and quality. I hope this shows at least we are listening and trying to make a change based off of feedback. :)
@beth-panx so you don't know the answer to my question. It would be nice if the next update regarding this topic would contain some real use case scenarios so we can all make an idea about the actual performance improvements. Thanks!
I’ve not noticed performance issues with my apps in WinUI at all. System apps, yes, file explorer top part is slow, hangs, etc. Performance issues for me are all Visual Studio Build related.
3 replies
Personal experience doesn't always reflect the underlying performance of the framework, especially at scale. If you look at objective benchmarks (like this one: https://github.com/Noemata/XamlBenchmark), WinUI 3 is currently measurably slower than both WPF and UWP. WPF is 20+ years old and even it is not native!!!. This is NOT ok. The gap is even wider when compared to native Win32 apps. While it’s great to see the platform evolving, it's crucial that the community keeps holding Microsoft accountable for these performance gaps so they actually fix them, and not comfort them that everything is ok.
Breaking changes are fine as long as they benefit devs in the end. I don't have any issue with launch time especially with AoT enabled. I do have a issue with unresolved bugs in WinAppSDK/CsWinRT/BuildTools though.
8 replies
One of many pressing issues is stutters in WinUI apps. Just look at the Store app. Amazing looking app but filled with lags/stutters/scroll delay. Every interaction takes >1s to respond.
You can't build a WinUI app and call it smooth at the same time.
The Store app is largely using UWP, with WinUI3 to some extent
The Store app is largely using UWP, with WinUI3 to some extent
Yap. The store app and the Setting app are both UWP. You can tell by resizing the windows...they don't show blank background unlike WinUI3 apps.
Love this. Amazing work. Looking forward to this
0 replies
What you need to do is actually use your framework across the company. Massive rewrites of everything in Windows OOB to this should be the highest possible priority in the company.
6 replies
As an ex-Microsoftie this was by far the most frustrating thing working with you guys, every team seemed to do their own thing. I hope you guys really push to fix that.
As an ex-Microsoftie this was by far the most frustrating thing working with you guys, every team seemed to do their own thing. I hope you guys really push to fix that.
Obligatory MSFT Organizational Charts by Manu Cornet:
The fact that the calendar view in the action center flyout is a WebView2 is perhaps the most pathetic result of this development so far.
MAUI team had to base the map control on top of Webview2, because to this day the native UWP map hasn't yet been ported.
Winui should be more customizable to attract more 3rd part dev to implement
0 replies
I really like this initiative, genuinely! But if Microsoft wants to make the Windows experience truly shine, the top two priorities should be rebuilding File Explorer and OneDrive from the ground up. The ripple effect those two have across the whole ecosystem is huge, and improving them would make everything else feel better too.
6 replies
If I remember correctly, OneDrive even uses Qt instead of the native tech stack, while on macOS it’s built with SwiftUI. Oh, that’s unbelievable.
I’ve always liked Windows, mostly because it’s what I grew up with. Up to now, I’ve put up with File Explorer and OneDrive because Linux still lacks some of the polish. But if Microsoft doesn’t sort these two out, Linux is going to eat Windows alive in the next few years.
With code generation becoming so cheap and accessible, the bar is rising fast. If Microsoft wants to stay competitive, I really hope they prioritise fixing this.
At our company everyone uses OneDrive, and honestly, it is one of the most frustrating parts of the workflow.
I only turn it on when I need to sync or download the latest files, then I turn it off again as soon as possible because it slows the whole system down. Syncing can take ages, and the storage handling is especially painful.
I once had about 100 GB available, let it fully sync, then suddenly I could not free up space anymore. I tried deleting files, but they just went to the recycle bin, and OneDrive still could not clean things up properly because there was not enough free space. So I was basically stuck, and the only practical solution was to buy more storage.
That kind of experience is exactly why people lose trust in it. File syncing should be reliable, and invisible and fast. OneDrive is the opposite far too often.
Glad to see the renewed focus on WinUI. The community waited a long time to see this change, and I hope dogfooding becomes part of the culture in Windows with WinUI.
Are you also looking to improve File Explorer context menu perf?
0 replies
(new) Outlook team take notes
1 reply
The (New) Outlook is a sheer proof that when it was conceived, in MS no one really cared about the quality of the final result. It is mindboggling how MS ever allowed such a unfinished, inferior, bad-performing app to ever craw out into the unsuspecting world. Not only that, but MS tried to shove it down our throats by installing it by default, retiring Mail & Calendar, and introducing a toggle button in classic Outlook. This means one thing - no one actually cared about quality. I do hope this changes.
Speaking of classic Outlook, the new To Do pane is again a web app. Pathetic.
Performance is a very welcome improvement.
However bringing back the .NET Native and C++/CX Visual Studio development experience is also quite relevant, and feature parity with everything that is still missing from Windows Forms and WPF features.
0 replies
I'd really like to dive in to WinUI. Could someone please point me to a good tutorial that focuses on deploying WinUI 3 apps. Last year I spent some time spinning something up and it was nice, until I went to deploy. It got very complicated very fast. The resources I found at the time didn't quite get me there. Thx.
8 replies
Thanks, but that specific small starter example just gets to the point of creating an app in the dev environment.
Also unless you miss the development experience of using Visual C++ 6.0 to develop ATL components, better not try to use C++/WinRT.
@Listbd Just add <WindowsPackageType>None</WindowsPackageType> in your csproj file, and change Packaged to UnPackaged in your Visual Studio (Green Play button), now you can Right Click on your project and click on ReBuild.
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
you can also right click on your project and click on Publish.
0 replies
I'm glad to see Microsoft making a concerted effort, listening to the concerns of users. Still, how efficient is WinUI 3 compared to bare Win32? Is the latter approach not feasible at Microsoft any more? If we look back at the old days, Windows applications and dialogs used to open instantly.
Thanks.
5 replies
WinUI is built on top of WinRT, which at its core is basically COM, with ref counting all over the place.
On UWP, with .NET Native and C++/CX, the runtimes have direct support for it, thus they can even elide AddRef/Release in some flows.
On Win32 side it is no different from using ATL (with C++/WinRT, different framework, same experience), and .NET has to deal with interop as the runtime integration with WinRT isn't there.
Naturally this slows everything down, then add on top the application identity with sandboxing.
Aside performance, the cognitive load it takes to write WinUI is excruciating. The back and forth between MIDL, Reflections, COM just makes it even worse. No matter how "easy" you make it, it can't get better. This feels like unnecessary bloat forced on developers to deal with.
Wish I could write stupid simple code to build simple apps on Windows.
A major problem with WinUI 3.0 is exactly that it isn't easy at all, especially for C++ devs.
On UWP, even if deprecated, you can reach out to C++/CX, which offers a development experience on Visual Studio, similar to VB, Delphi, or to stay on C++ camp, C++ Builder and QtCreator alongside Design Studio.
Instead a couple of devs rioted, and with the backing of Microsoft management, replaced that whole experience with C++/WinRT, without any Visual Studio tooling comparable to C++/CX.
The promises of tooling made at CppCon 2017 talk, which is relatively easy to track down, were never delivered.
Nowadays those folks are enjoying Rust, on the windows-rs crate, C++/WinRT is only getting occasional bug fixes, and anyone that still buys into WinUI marketing gets to enjoy a similar experience like doing ATL with Visual C++ 6.0 back in 2000.
If the team wants to win back those of us that left, are only around to explain the reality behind the marketing to newcomers, they need to catch up quite a bit, not only blog posts.
WinUI is built on top of WinRT, which at its core is basically COM, with ref counting all over the place.
Thanks for the helpful descriptions. As one coming from C++/MFC/Win32, the proliferation of modern runtimes and APIs is quite confusing. It all seems one big mess.
Windows doesn't make it easy for us to develop Windows apps.
Links within the docs just point to unrelated development paradigms. Some docs were written at the time of UWP were simply ported to WinAppSdk with all wrong links. This may not be an issue in all cases but behavioral differences between the APIs of the two paradigms have been diverging, and WinAppSdk requires extra steps in some cases. Btw, XAML in UWP is not the XAML in WinAppSdk WinUI, but they are still just "XAML".
Personally, I hope that WinUI3 can implement a declarative development paradigm to some extent, which is the unified choice of almost all modern view frameworks.
1 reply
Moving from WinUI 2 to WinUI 3 should always be a clear win for performance, and apps should get great results without heavy lifting.
This is not true for my existing WinUI 2 VB projects. It's painful to patch the XAML compiler to extend language support since the XAML compiler is closed source.
0 replies
5 replies
Number 2 is important. Performance testing should be done on 2010-era hardware and HDDs. Part of the problem today sprang, paradoxically, from SSDs, faster CPUs, and abundant RAM: faster hardware led to practices where efficiency became less of a concern, since sluggishness would be masked.
Little by little, slow code ate away the hardware gains, and we have got a situation today where applications used to open faster on XP over two decades ago.
Testing with a machine with minimum requirement for Windows 11 should be enough. And yes, testing should be done on integrated graphics.
Number 2 is important. Performance testing should be done on 2010-era hardware and HDDs. Part of the problem today sprang, paradoxically, from SSDs, faster CPUs, and abundant RAM: faster hardware led to practices where efficiency became less of a concern, since sluggishness would be masked.
Little by little, slow code ate away the hardware gains, and we have got a situation today where applications used to open faster on XP over two decades ago.
You've hit the nail on the head. HDD is a particularly important point, and I've updated my comment.
Testing with a machine with minimum requirement for Windows 11 should be enough. And yes, testing should be done on integrated graphics.
In IoT scenarios, many configuration requirements and restrictions have been removed in Windows 11. Therefore, older configurations still need to be considered.
Testing with a machine with minimum requirement for Windows 11 should be enough. And yes, testing should be done on integrated graphics.
Also Windows 10. For example, on my Windows 10 22H2 OS, I have still this issue : #10092 (30 FPS instead of 60 FPS)
Leet's goo, finally!
Question, those improvements you have shared in the table are with AoT enabled or not?
0 replies
Please also work on updating the UI of the bottom 3/4 of File Explorer, which still uses design elements from Windows 8/10. File Explorer needs the glow-up it deserves.
0 replies
There needs to be an easy way to use WinUI in applications coded in Python and Rust.
2 replies
Can you give us visual editor we used to have in the 90s and 2000s, so actual developers can easily design windows using drag&drop using latest UI tech?
1 reply
Using C++ for WinUI3 development is pretty clunky, because it leads to a lot of performance being wasted in C# apps due to CsWinRT interoperability. Plus, if you go with native C++ for development, you'll have to put up with super low development efficiency.
3 replies
After killing C++/CX and replacing it with C++/WinRT there was never a demo at BUILD with C++, because the audience would disconnect the moment they would see manually editing of IDL files and moving around generated code.
I have a dream that ms office apps on Windows were rewritten in WinUI.
2 replies