Bug 60658 - Nested StackLayout Performance Problem - UWP Only
Summary: Nested StackLayout Performance Problem - UWP Only
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-11-13 23:52 UTC by Melbourne Developer
Modified: 2017-11-14 03:35 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Melbourne Developer 2017-11-13 23:52:36 UTC
I have created a TreeView control which nests Grids and StackLayouts many levels deep to create tree nodes. It works very well on Android and UWP, but when the nodes reach about 3-4 levels deep, performance drops off very quickly on UWP. Performance is fine on Android. On UWP, when the page is loading, the window goes white for a few seconds, and then eventually the tree view is displayed. The TreeView then works correctly, but if you resize the window, the app chugs again.

I've debugged my own code and I can't see that it is doing anything wrong. I've put break points in my methods, and they are not getting hit while the screen is going white, or resizing is occurring. I wanted to debug the XF core library myself, but couldn't figure out how to. Please see this thread https://forums.xamarin.com/discussion/106569/debugging-xamarin-forms/p1?new=1.

To repro the problem:

1) Check out this repo https://github.com/MelbourneDeveloper/Adapt.Presentation.git
2) Run the sample on UWP 
3) Go to the TreeView tab. Notice that the TreeViews work correctly and performance is fine.
4) Run the sample on Android
5) Go to the TreeView tab. Notice that the TreeViews work correctly and performance is fine.
6) Open the file TreeViewPage.xaml.cs
7) Uncomment out the lines that say "Uncomment for UWP performance bug"
8) Run the sample on Android
9) Go to the TreeView tab. Notice that the TreeViews work correctly and performance is fine. 
10) Run the sample on UWP 
11) Go to the TreeView tab. Notice that the screen locks up for a few seconds
12) Notice that you can use the TreeViews normally
13) Try resizing the Window. Notice that the screen chugs
Comment 1 Paul DiPietro [MSFT] 2017-11-14 00:24:35 UTC
Try running against 2.4/2.5 to see if it resolves the draw issue, since everything still appears to be running against 2.3.4. There were fixes that in this instance also appear to make a difference when updating.
Comment 2 Melbourne Developer 2017-11-14 03:06:55 UTC
PS: We are about to make this repo private. We are waiting on you to have a look at this bug before we make it private. Can you please let us know as soon as you have the code so that we can make this repo private?
Comment 3 Melbourne Developer 2017-11-14 03:35:49 UTC
Confirmed. Upgrading to 2.4.0.74863 has fixed the issue.