Dynamic SfDataForm slow initial load and slow scrolling + [View] requestLayout() improperly called

Hi!


I'm having issues with data form causing the Xamarin Shell App to slow down significantly with dynamic visibility and required properties being set at run time.


Some background on how the logic flows in our app:

We are using Xamarin Shell for navigation inside our app.

We have about 35 properties that can have their editors dynamically be visible or not and be required or not.

That information is fetched from API and should present a dynamically built data form.


Initially I did this by just loading the data form with all properties as visible and then after api data comes in, hide the ones that aren't needed. That proved to be blocking the UI thread for few seconds on Android and be extremely choppy on scrolling with iOS.

I solved this issue by setting the Cancel property on each data form item to true on initial load and after the data from API came in, I called the RefreshLayout() on data form and through usage of flag setting I was able to turn those property editors to be visible. That is still relatively slow on Android and it seems to block the UI thread when those properties are turned back on. iOS doesn't have that much of an issue with that.


Mainly our issues are that scrolling is a bit choppy and much much less fluid than on something like Xamarin Forms CollectionView or some similar scrolling element.


Few things I noticed while dealing with this issues:

1.) After I scroll through the list of Data Form editors on iOS, the scrolling is then really smooth - no hiccups or any issues. But scrolling to bottom when the view is first loaded is relatively choppy.


2.) Android seems to maintain the same choppines even after it was scrolled to the bottom.


3.) Android seems to be really blocking the UI thread on creating/updating the Data Form editors, for example on an initial button press to load a new view with 30 editors in data form it blocks at button press animation for about 2-3 seconds and then loads the view - really noticeable.


4.) On Android when scrolling up and down I get the following message spammed a few times:

[View] requestLayout() improperly called by crc64be068f9952f30593.ScrollPanel{dbdb523 V.E...... ......I. 0,0-1025,6802} during layout: running second layout pass


5.) On Android (Xiaomi Redmi Note 9 Pro device) I get spammed (much more than previous point) with the following message when scrolling:

[ForceDarkHelper] updateByCheckExcludeList: pkg: com.<OUR APP NAME> activity: crc6477568f4ea618ef40.MainActivity@e540665

-- I understand that this might have something to do with MIUI (Xiaomi Android version), but it still isn't showing that much (only once when initially loaded) when scrolling on SfListView or Xamarin's CollectionView


6.) Validation is working without much issues - no problems there



How the SfDataForm looks defined in Xaml:

<dataForm:SfDataForm x:Name="dataForm"

                     LayoutOptions="TextInputLayout"

                     ValidationMode="LostFocus"

                     Grid.Row="1"

                     VerticalOptions="FillAndExpand"

                     HorizontalOptions="FillAndExpand"

                     Validating="dataForm_Validating"

                     AutoGeneratingDataFormItem="dataForm_AutoGeneratingDataFormItem">

</dataForm:SfDataForm>


I'm assigning the dataForm's DataObject when instantiating the ViewModel inside the View's shell route parameter set handling:

[QueryProperty(nameof(AuctionId), "auctionId")]

private string _auctionId;

public string AuctionId

{

get { return _auctionId; }

        set

        {

         _auctionId = value;

                AddNoUpcAuctionItemViewModel = new AddNoUpcAuctionItemViewModel(this);

                dataForm.DataObject = AddNoUpcAuctionItemViewModel.NoUPCAuctionItem;

                BindingContext = AddNoUpcAuctionItemViewModel;

        }

}


Please not that I'm not using behaviours - not sure if that could be the issue?


Details about our project:

Syncfusion packages version: 19.2.0.51

Xamarin Forms: 5.0.0.2012

androidx.recyclerview (not sure if you are using this to implement SfDataForms): 1.2.1.1


Devices:
iPhone SE
iPhone 8
Xiaomi Redmi Note 9 Pro
Google Pixel 3A XL


Unfortunately the project is quite complex and isn't free to public so I can't give you the entire source code - but if I can do anything more, please let me know.


19 Replies

SS SaiGanesh Sakthivel Syncfusion Team August 23, 2021 12:16 PM UTC

Hi Stig, 
 
Thank you for using syncfusion products. 
 
#Regarding Dynamic SfDataForm slow initial load and slow scrolling and [View] requestLayout() improperly called 
Currently, we are validating the reported scenario and we will update the further details on or before the August 25,2021. We appreciate your patience until then. 
 
Regards, 
SaiGanesh Sakthivel 



FE Fer August 23, 2021 12:29 PM UTC

Thanks! And a quick question - is performance much different between debug and release configuration? Not sure if there are any additional performance improvements while on release configuration.



SS SaiGanesh Sakthivel Syncfusion Team August 24, 2021 12:49 PM UTC

Hi Fer,  
  
Thank you for the update.  
   
Currently, we are analysis the reported scenario from the source level and we will update the further details on the August 25,2021. We appreciate your patience until then.  
  
Regards,  
SaiGanesh Sakthivel  



SS SaiGanesh Sakthivel Syncfusion Team August 25, 2021 01:17 PM UTC

Hi Fer, 
 
Thank you for the patience. 
 
Query1: Scrolling the dataform is choppy 
We have prepared the sample as per given information and check the reported scenario from our side. We regret to inform you that the dataform scrolling is working as expected and there is no choppy from our end. we have tested the sample with android 10 (RealmeX2 pro device). We have attached the tested sample and tested video in the following link for your reference. 
 
 
 
let us know it you still facing the same issue. If not, could you please share the following details which would be helpful for us to check on it and provide you the solution at the earliest.  
 
·       Modify our sample. 
·       Share the issue replication procedure and issue replicate video. 
·       Synfusion and Xamarin Forms updated version 
 
Query2: RequestLayout() method error in output window. 
Currently, we have checking the reported scenario in our source level and we will update you the further details on August 27, 2021. We appreciate the patience until then. 
 
Query 3: [ForceDarkHelper] updateByCheckExcludeList error message in MI device 
We regret to inform you that we could not replicate the reported error message in our device. We have tested with Mi redmi note 5 device. We have attached the tested sample in the following link for your reference. 
 
 
Query 4: initial button press to load a new view with 30 editors in data form it blocks at button press animation for about 2-3 seconds 
We have checked the reported scenario from our end. We would like to inform you that while dynamically loading the dataform into the view, it will take some time to renderer the UI in the view. It is an expected behavior. 
 
Query 5: is performance much different between debug and release configuration? 
The performance in debug and release configuration will be same. 
 
Please let us know if you have any concerns. 
 
Regards,
SaiGanesh Sakthivel
 



SS SaiGanesh Sakthivel Syncfusion Team August 27, 2021 12:48 PM UTC

Hi Fer, 
 
Thank you for the patience. 
 
#Regarding RequestLayout() method error in output window 
We would like to inform you that we have logged issue report for the same. We will fix the issue and include the issue fix in our upcoming Weekly Nuget release which is expected to roll out on September 14, 2021. We appreciate your patience until then. 
 
You can track the status of this report through the following feedback link, 
 
Note: The provided feedback link is private, you need to login to view this feedback. 
 
Regards, 
SaiGanesh Sakthivel 



FE Fer August 27, 2021 01:45 PM UTC

Thanks for your fast responses and repro projects.


I have tested your sample, and rapid scrolling is choppy and slow feeling on Android.
On iOS it is a bit choppy and slow feeling as well (I tested only with Hot Restart used for deploying to device).


However, in our application I think that iOS is working fine if the app is not deployed to iOS device via Xamarin's Hot Restart, but with a build with Mac device. We don't have performance issues anymore with iOS when built with Mac and distributed for test via TestFlight. I would like to get feedback from your side if you have any issues with performance if it was deployed to iOS device using the Windows machine and Hot Restart and if those went away with usage of Mac device for a build.


I'm attaching the usage of Profile HWUI (Developer option in Android devices) videos on how it looks inside our app, as well as your demo project - I'm not an expert on UI element rendering stuff, but this seems like a big performance issue somewhere.
https://we.tl/t-kEJNrKamnA

Please note, file is larger than 30MB so I'm using an external file transfer service


Once again, thanks for being responsive - I really like using the DataForm controls, hopefully we'll be able to get to the bottom of my performance issues



SS SaiGanesh Sakthivel Syncfusion Team August 30, 2021 11:13 AM UTC

Hi Fer, 
 
Thank you for the update. 
 
#Regarding Performance issue in SfDataForm 
Currently, we have analysis the reported scenario in our source level and we will update you the further details on September 1, 2021. We appreciate your patience until then. 
 
Regards,
SaiGanesh Sakthivel
 



SS SaiGanesh Sakthivel Syncfusion Team September 1, 2021 01:00 PM UTC

Hi Fer, 
 
Thank you for the patience. 
 
#Regarding Performance issue and RequestLayout()  
We have analyzed the reported queries from our end. Further analysis, we have found that the reported scenario is a framework issue and we have already logged an issue report for the same with Xamarin, kindly refer the following link for the same, 
 
 
We are having following the reported bug, once we got the solution from the Xamarin team, we will update you the further details. We appreciate your patience until then. 
   
Regards, 
SaiGanesh Sakthivel


FE Fer September 2, 2021 11:37 AM UTC

Hey!


Thanks for being proactive about this issue. I have seen that member of Xamarin team has responded about the need for RecycleView. Is this something that can be implemented by your end soon?


We really love using DataForm, but performance is a bit lacking when it comes to Android. iOS seems to not have any issues when it is built via real Mac device, and not via HotRestart functionality.



MS Muniappan Subramanian Syncfusion Team September 3, 2021 01:45 PM UTC

Hi Fer,   
 
Currently, we have forwarded your query to our development team after analysis with them. We will update the further detail on or before September 7th, 2021. We appreciate your patience until then.    
 
Regards,   
Muniappan S 



SS SaiGanesh Sakthivel Syncfusion Team September 7, 2021 02:24 PM UTC

Hi Fer, 
 
Thank you for the patience. 
 
#Regarding Performance issue in SfDataForm  
According to our requirements, we need to add Scroll Viewer as the base and add children's in it. As reported, the issue is replicated in a simple sample, so we are following it up with a possible fix from the Framework and will let you know once they respond. 
 
  
Regards, 
SaiGanesh Sakthivel 



FE Fer September 10, 2021 03:44 PM UTC

Hi!

Is there any progress being made on improving the performance on Android? This is currently blocking us with release of few new features, we would really appreciate some time info on this.


Thanks in advance!



SS SaiGanesh Sakthivel Syncfusion Team September 13, 2021 12:37 PM UTC

Hi Fer, 
 
Thank you for the update. 
 
#Regading [Android]Performance issue with GPU rendering due to RequestLayout improperly called in native ScrollViewer 
We would like to inform you that we have logged issue report for the same. We will fix the issue and include the issue fix in our upcoming Weekly Nuget release which is expected to roll out on October 05, 2021. We appreciate your patience until then. 
 
You can track the status of this report through the following feedback link, 
 
Note: The provided feedback link is private, you need to login to view this feedback. 
 
Regards, 
SaiGanesh Sakthivel 



FE Fer October 4, 2021 07:38 AM UTC

Hey!

Are there any new information about this? Will this get resolved in the October 5th update?


Thank you in advance!



SS SaiGanesh Sakthivel Syncfusion Team October 5, 2021 12:30 PM UTC

 
Sorry for the inconvenience caused. 
 
#Regading [Android]Performance issue with GPU rendering due to RequestLayout improperly called in native ScrollViewer 
We regret to inform you that the issue fixing is delayed due to the framework hurdle. We are trying to fix the issue in an alternative way, which is taking more time than we expected. We will fix the reported issue and include it in our upcoming weekly nuget release, which is planned to roll out on October 19, 2021. We will let you know once the release is rolled out and appreciate your patience until then.  
 
Regards,
SaiGanesh Sakthivel
 



MS Muniappan Subramanian Syncfusion Team October 19, 2021 12:57 PM UTC

Hi Stig, 
 
Sorry for the inconvenience caused.  
 
#Regading [Android]Performance issue with GPU rendering due to RequestLayout improperly called in native ScrollViewer  
 
We regret in informing you that there is going to be a delay longer than expected in making this work. Delays are mainly due to the framework hurdle. We are trying to fix the issue in an architecture-level change in SfDataForm, which is taking more time than we expected. We will fix the reported issue and include it in our upcoming 2021 Vol 4 release which is planned to roll out in the mid of December 2021. We will let you once the release is rolled out and appreciate your patience until then. 
 
Regards, 
Muniappan S. 



FE Fer December 3, 2021 02:39 PM UTC

Any news on this? I have also been having weird layout issues on both platforms when using more than just dataform element.
Do you have some guides on best practices and consideration for that? https://help.syncfusion.com/xamarin/dataform/getting-started#loading-dataform-inside-stacklayout I followed this guide and added a button at the end, but when the dataform is quite long, the formatting is way off and not working the same on android and ios platforms



SS SaiGanesh Sakthivel Syncfusion Team December 6, 2021 12:27 PM UTC

Hi Fer, 
 
Thank you for the update. 
 
#Regading [Android]Performance issue with GPU rendering due to RequestLayout improperly called in native ScrollViewer 
We have fixed the reported issue and the issue fix will include it in our upcoming 2021 Vol 4 release which is planned to roll out in the mid of December 2021. We will let you once the release is rolled out and appreciate your patience until then. 
 
#Regarding adding the button at the end of the layout 
We have checked the reported query from our end. we could not replicate the reported scenario from our side. We have prepared the sample and checked the sample with Android 9 API 28 (Honor 9N lite device) and iPhone 8 simulator. We have attached the tested sample in the following link your reference. 
 
 
Please check the sample and let us know if you still facing the same issue? If not, please modify our sample based on your scenario and revert us back with the following details, 
 
·       Issue reproducing video 
·       Syncfusion and Xamarin.Forms update version 
 
It will be helpful for us to check on it and provide you the solution at the earliest. 
  
Regards,
SaiGanesh Sakthivel
 



MS Muniappan Subramanian Syncfusion Team December 21, 2021 11:48 AM UTC

Hi Fer, 
 
We are glad to announce that our Essential Studio 2021 Volume 4 Main Release V19.4.0.38 is rolled out and is available for download under the following link. 
 
 
The mentioned issue with “[Android]Performance issue with GPU rendering due to RequestLayout improperly called in native ScrollViewer “issue has been fixed and included in this release. 
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Muniappan S 


Loader.
Up arrow icon