Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic dependencies have a significant impact on application startup time #4697

Open
lhak opened this issue Sep 7, 2024 · 5 comments
Open
Assignees
Milestone

Comments

@lhak
Copy link

lhak commented Sep 7, 2024

Describe the bug

Looking at startup time of winui applications, I noticed that using dynamic dependencies for unpackaged apps has a significant impact. Compared to using appsdk self contained deployment, using dynamic dependencies increases startup time by 100-300ms depending on processor speed.

Interestingly, using the Windows functions TryCreatePackageDependency() and AddPackageDependency() for the appsdk runtime package results in a lot better performance. So I guess improvements should be possible here.

Steps to reproduce the bug

Use https://github.com/jonathanpeppers/measure-startup to measure the startup time of unpackaged apps with and without appsdk self contained deployment enabled.

Expected behavior

No response

Screenshots

No response

NuGet package version

Windows App SDK 1.6.0: 1.6.240829007

Packaging type

Unpackaged

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

@DarranRowe
Copy link

There was work being done to just use the Windows 11 Dynamic Dependencies API when available, I wonder what happened to it.

@mominshaikhdevs
Copy link

this is the PR: #4136

@DrusTheAxe
Copy link
Member

Interestingly, using the Windows functions TryCreatePackageDependency() and AddPackageDependency() for the appsdk runtime package results in a lot better performance

Not too surprising. We made changes inside Windows to enable that behavior. Unfortunately these changes required pretty deeply invasive (read: high risk) changes to make downlevel, thus WinAppSDK has its own parallel implementation that approximates the same net result but using mechanisms already available on e.g. RS5. So the latter works (yay!) but can't be quite as lean as the former.

@DrusTheAxe
Copy link
Member

There was work being done to just use the Windows 11 Dynamic Dependencies API when available, I wonder what happened to it.

It ran into a couple of deep technical snags requiring more time than available to sort out so it got deferred (sleepy, not dead :-)

But for all things a season... I've started digging back into this. It's a little tricky to thread the needle to enable without introducing regressions, but I'm cautiously optimistic it'll get it sorted out soon enough.

I've actually been itching to get my hands on this for a while. Looking forward to hacking away, even if it's a meticulous hackery. Stay tuned.

@DrusTheAxe DrusTheAxe self-assigned this Sep 12, 2024
@DrusTheAxe DrusTheAxe added this to the 1.7 milestone Sep 12, 2024
@DrusTheAxe
Copy link
Member

FYI MS tracking => https://task.ms/47326505

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants