Open MAUIoxo opened 2 weeks ago
One thing that might help is if you ran a profiler on the app and attach a speedscope: https://github.com/dotnet/maui/wiki/Profiling-.NET-MAUI-Apps
Maybe something will appear like loading some data/image in the constructor or another part of the binding. Maybe there is a lay loading something from the DB in a binding.
I wanted to do that and ran Time Profiler on XCode connected to my iPhone and I launched the App. After that started the recording when I switched to the second tab. The Time Profile showed a "Hang". I wanted to store that as a speedscope file, but to be honest, I don't know how to do that. When I click on XCode > Time Profile > File > Save As > my_profile.trace I get a folder structure named my_profile.trace
When I Drag&Drop that entire folder to the speedscope website, I get an error "Something went wrong. Check the JS console for more details."
. How can I convert that? (I am using XCode Version 16.0)
Description
I have a
ContentView
inXAML
that is displayed after switching a tab. TheContentView
is not too complicated in my opinion:Nevertheless, the creation of this
ContentView
when displayed for the first time takes too long so that there is a bad user experience which is like having a lagging UI:The example uses Sharpnado.Tabs to switch between the
Views
. This component allows 3 different kinds ofViews
, aLazyView
,DelayedView
(which shows an activity indicator while loading theView
) and also a normal.NET MAUI View
. I tried all of them and they show the same behavior.LazyView
andnormal .NET MAUI View
feel like they are laggy since theView
does not show up instantly after clicking theTab
and they show up with a delay with is too long and not acceptable in my opinion. Even on my local iPhone 14 Pro Max it is laggy after clicking.The
DelayedView
switches to theView
faster and at least shows the background and some things that show the user that her click was performed. But thisView
also displays anActivityIndicator
that runs until theView
is fully loaded to bridge the wait time for the user and make this delay more acceptable. However, if only 2-3 elements are displayed afterwards in theCollectionView
and not hundreds of elements, it still feels strange to the customer why they see a spinning hourglass for only so few items. The question remains, though, why the creation of the View has to take so long when displayed for the first time. For me, this is a fundamental issue in .NET MAUI.After it was displayed for the first time it is possible to fluently switch back and forth between the tabs:
ContentView
including itsViewModel
in advance and assign its content when the Tab was clicked (Caching of the View), but this did not help[XamlCompilation(XamlCompilationOptions.Compile)]
, but this also did not help to prevent this delay when created for the first timeSteps to Reproduce
DXCollectionView
as the performance is usually betterContentView
like that takes too long and is a performance issueLink to public reproduction project repository
DisplayViewDelay_25754
Version with bug
8.0.92 SR9.2
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android
Affected platform versions
iPhone 15 Pro Max iOS 17.4
Did you find any workaround?
No workaround so far
ContentView
including itsViewModel
in advance and assign its content when the Tab was clicked (Caching of the View), but this did not help.[XamlCompilation(XamlCompilationOptions.Compile)]
, but this also did not helpRelevant log output