[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). |
jonathanpeppers
left a comment
There was a problem hiding this comment.
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.Pathto save about 4 ms (measured in Debug mode) for each call ofFileSystemUtils.PlatformGetFullAppPackageFilePath1 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. ↩