-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Performance degradation when navigating to a page and going back several times #12930
Copy link
Copy link
Closed
Closed
Copy link
Labels
area-controls-shellShell Navigation, Routes, Tabs, FlyoutShell Navigation, Routes, Tabs, Flyoutfixed-in-8.0.0-preview.3.8149Look for this fix in 8.0.0-preview.3.8149!Look for this fix in 8.0.0-preview.3.8149!p/1Work that is important, and has been scheduled for release in this or an upcoming sprintWork that is important, and has been scheduled for release in this or an upcoming sprintpartner/cat 😻this is an issue that impacts one of our partners or a customer our advisory team is engaged withthis is an issue that impacts one of our partners or a customer our advisory team is engaged withperf/generalThe issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)platform/androidplatform/iosplatform/windowst/bugSomething isn't workingSomething isn't working
Milestone
Metadata
Metadata
Assignees
Labels
area-controls-shellShell Navigation, Routes, Tabs, FlyoutShell Navigation, Routes, Tabs, Flyoutfixed-in-8.0.0-preview.3.8149Look for this fix in 8.0.0-preview.3.8149!Look for this fix in 8.0.0-preview.3.8149!p/1Work that is important, and has been scheduled for release in this or an upcoming sprintWork that is important, and has been scheduled for release in this or an upcoming sprintpartner/cat 😻this is an issue that impacts one of our partners or a customer our advisory team is engaged withthis is an issue that impacts one of our partners or a customer our advisory team is engaged withperf/generalThe issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)platform/androidplatform/iosplatform/windowst/bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
Each time a page navigates to another created by a dependency service as a result of a call to
Shell.Current.GoToAsynca new instance of that page is created and the time to create and/or navigate to that page is incrementally extended.The attached sample project demonstrates this behavior.
The project is standard MAUI template app with a
MainPageand an additionalNewPagewith some controls on it to speed up the effect of delaying. The idea is that theMainPagenavigates to theNewPageand then theNewPagereturns back toMainPagein a loop and the loading time of theNewPageis measured and displayed. This loading time get gradually increased.Timers have been added to
MainPageandNewPage. When the timer event occurs in theMainPagethe current time is taken and navigation to theNewPageis initiated. WhenNewPagefinishes loading, it displays how long it took to load. The timer inNewPagethen triggers a "back" action by executingShell.Current.GoToAsync(".."). TheMainPagetimer starts again and the loop continues infinitely.You can notice that the load time (in milliseconds) presented in
NewPageincreases with each iteration. After 20-30 iterations, the loading time becomes a few seconds and continues to grow.This behavior is observed on all three tested platforms – iOS, Android and Windows.
No latency increase is observed when
NewPageis added to the dependency service as aAddSingleton<NewPage>()and progressively increasing latency is experienced when added as aAddTransient<NewPage>().Steps to Reproduce
Please run the attached project and click the button "Start the loop" then observe the number in the page that shows up.
Link to public reproduction project repository
https://github.com/gkamenov/MauiBug
Version with bug
7.0 (current)
Last version that worked well
7.0 (current)
Affected platforms
iOS, Android, Windows
Affected platform versions
iOS 14.2 and up, Android 8 and up, Windows build 22621.1105
Did you find any workaround?
No workaround so far.
Relevant log output
No response