[Performance issue] Creation and display of ContentView takes too long when displayed for the first time #25754
Labels
area-layout
StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter
t/bug
Something isn't working
t/perf
The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)
Milestone
Description
I have a
ContentView
inXAML
that is displayed after switching a tab.The
ContentView
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
The text was updated successfully, but these errors were encountered: