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.

UWP app launches very slow with many assets

See original GitHub issue

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:

  1. Create a blank app
  2. Launch it - observe it starts up almost immediately
  3. Add 1000 small images in the Assets folder (even icons are enough)
  4. 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.

Profiler results

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:open
  • Created 3 years ago
  • Reactions:5
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
ranjeshjcommented, Apr 1, 2020

@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.

2reactions
bartjrooscommented, Apr 12, 2022

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best practices for your app's startup performance
Create Universal Windows Platform (UWP) apps with optimal startup times ... your app is fast or slow based on how long it takes...
Read more >
Slow performance of UWP apps
I know in Delphi applications, forms with only a few components on it are loading instantly. Sorry for asking here… Many thanks in...
Read more >
Why is my UWP app laggy (only) under Windows 11?
Since several years I have an UWP app (card game) in the Microsoft Store. It is well tested and runs fluidly on Windows...
Read more >
Build time of UWP C# projects takes too long
create a brand new C# Universal Windows app, and build it. ... productivity (inner loop) is multiple times slower than for a similar...
Read more >
UWP Apps Are Very Slow & Lag in Windows 11/10? | Fix It ...
Have you come across the Windows 11 UWP apps lag issue? Now, you come to the right place. This post provides several effective ......
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