Open MartinZikmund opened 4 years ago
@Austin-Lamb @bartekk8 The repro is with just the platform bits (no winUI).
@ranjeshj That is true, it would not matter if I added Microsoft.UI
. Unfortunately there is no better place to report UWP issues (that would be seen by the developers), that's why I posted the problem here. I will repost it on Windows Feedback too, but I am not sure it will reach the developer team from there.
@MartinZikmund You have the correct repo :). With WinUI3 the platform bits are being moved out of the OS. So we can track this issue here. Thanks for reporting.
Hi guys, I'm having the exact same issue. Just wondering if anyone has found a solution and/or source of the problem yet, thanks!
I'm also running into this issue and discovered that it's irrelevant if there's many Assets included in the .csproj (as is the case in the original posters' repo). As long as there are a lot of assets in the AppX output directory, the slowdown occurs. The hang occurs on rootPage.Navigate
in the App.xaml.cs
.
Apparently it also has to do with the image size on my end, I've compressed a few images in the app assets and the startup time went to just 3 seconds on debug from around 11 seconds. It's not the sample repro project shared here that I tried this with, though.
@bartjroos My workaround here was to add the assets into a single .zip
file, which I extract to ApplicationData
folder on first launch. Then, I reference the files via ms-appdata:///Local/
instead of ms-appx
. It means the app takes up twice the storage space though, so it is not a "proper" solution. On the other hand, this way the app launches very fast, especially on second and subsequent launches, where the extraction can be skipped.
Describe the bug
UWP app launch length is proportional to the number of assets included in the project (e.g. images with Build Action set to Content). Even for a simple blank page, which does not do anything, just having many assets present in the application package causes the app to load extremely slow - while the code is not touching them at all.
Steps to reproduce the bug Steps to reproduce the behavior:
Assets
folder (even icons are enough)For better convenience, I have created a simple repro here on GitHub. It contains two apps - one is simple blank UWP app without any assets, second is a blank UWP app with many image content assets (which are however not used at all.
Expected behavior
When app does not use the content files in any way, they should not affect the launch time of the app (as the files are already deployed with the package, so the app should not manipulate them on start).
Screenshots
Profiler output
Notice the profiler shows all the launch time spent in Window Resized.
During debugging, you can see there is almost no CPU nor RAM activity during this wait time.
Version Info
NuGet package version: none required, classic UWP is sufficient
Additional context
Noticed this long ago with my app which has a lot of content icon images, but now I finally found out what is the root cause of it launching this slow.