-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Windows] Cache full app package file path #21246
[Windows] Cache full app package file path #21246
Conversation
Hey there @MartyIX! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change makes sense.
In the attached issue, there was:
@MartyIX do you have a more recent .speedscope
from your app? We should get a second data point on how much time this can save in a real application.
Oh, I found the Seems like an easy-win. 👍 |
I don't really know how to profile my real application with modified MAUI source code. So I'm testing with the sandbox project in MAUI source code. However, I tested with MartyIX@ab01bf4 and it saved about 20 ms AFAIK. But it depends on the number of files. So if there is an app with 50 font files, then I would expect to save about |
If you ever need to test a local MAUI build, I do:
This might be trickier with a Windows app that is a "packaged" appx, though. Might have to launch VS with |
@rmarinho Is this OK to merge? Or are there any concerns? |
pinging @mattleibow as he knows more about this that me :) |
Description of Change
I have noticed that one can cache
Package.Current.InstalledLocation.Path
to save about 4 ms (measured in Debug mode) for each call ofFileSystemUtils.PlatformGetFullAppPackageFilePath
1 because there is no interop call to WinRT2.Testing
/~https://github.com/MartyIX/maui/tree/feature/2024-03-16-app-path-optimization-testing (MartyIX@ab01bf4)
Issues Fixed
Contributes to #8594
Footnotes
Called for each registered font (see Font loading impacts Windows desktop startup #8594). ↩
Please correct me if I got it wrong. ↩