UWP app launches very slow with many assets
See original GitHub issueDescribe 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:
- Create a blank app
- Launch it - observe it starts up almost immediately
- Add 1000 small images in the
Assets
folder (even icons are enough) - Launch app - it may now take even 20 seconds to launch
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
Windows 10 version | Saw the problem? |
---|---|
Insider Build (xxxxx) | Yes |
November 2019 Update (18363) | Yes |
May 2019 Update (18362) | Yes |
October 2018 Update (17763) | Yes |
April 2018 Update (17134) | |
Fall Creators Update (16299) | |
Creators Update (15063) |
Device form factor | Saw the problem? |
---|---|
Desktop | Yes |
Mobile | Yes |
Xbox | |
Surface Hub | |
IoT |
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.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:7 (4 by maintainers)
@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!