We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Using cached images in sfListView / GridLayout performance

Thread ID:





129106 Feb 28,2017 02:44 AM UTC Mar 3,2017 03:38 PM UTC Xamarin.Forms 3
Tags: SfListView
Russ Fustino
Asked On February 28, 2017 02:44 AM UTC

Does the SyncFusion ListView  derive from the Xamarin Forms ListView? If so, is there a new property available called “CachingStrategy=RecycleElement”  or an equivalent as was recently made available with Xamarin Forms ListView? I am trying to reduce load time on a ListView page initially and on subsequent loads. I am seeing 4-12 seconds, depending on the tablet device  Grid Layout ListView for loading and 2-6 seconds for re-loading depending on the tablet device. I have about 60 images in the ListView, each are 160x160 thumbnail png files, I am using 5 columns wide. Total size of all 60 thumbnails is 900 KB. Runs fine in the Visual Studio emulator BTW, just seeing the delays when deployed to actual device. I have set my Android options to Max Java Heap Sixe to 1G. If you think of any other settings that impact this please let me know as well as if .png vs .jpg has an impact on performance.

I have tried to cache Images with the latest sfListView control  using the FFImageLoading NuGet Package https://github.com/luberda-molinet/FFImageLoading , but the app is crashing with a runtime error: System.Threading.Tasks.TaskCanceledException: A task was canceled .

It works with a non-SyncFusion ListView and it runs when I use a regular image control . Here is my XAML below and the image files are accessed in the head project (IE not embedded resources in the PCL) . Or are there any other cached images plug-ins of Sf caching image controls that work with sfListView?

In Main Activity


                Source="{Binding thumb_file_image_name} Converter={StaticResource ImageConverter}"

Dinesh Babu Yadav [Syncfusion]
Replied On March 1, 2017 04:34 AM UTC

Hi Russ, 
Thank you for contacting Syncfusion support. 
Query 1: 
SfListView is completely developed with UI Virtualization(Item recycling) concept and it only creates the element only which are in view on initial loading. While scrolling, we have cache the created elements and recycled it by updating only the BindingContext of the SfListView item. However, when multiple images are loaded in SfListView and deployed in android platform, the images are rendered by the native android renderer, so it takes some time to create the view completely and leads some performance degradation on scrolling. Hence, we have tried to achieve your requirement for better loading of images upon scrolling by customizing the Xamarin.Forms.Image in our sample. We have attached the sample for your reference and you can download a copy of it from the below link.  
Could you please check with the above sample? If the issue still reproduces at your end, please modify the above sample to reproduce the issue and update us with replication procedure or video link. So, that we can analyze the issue and update an appropriate solution. 
Query 2: 
Currently we are working on the reported “Runtime error(TaskCanceledException) throws when SfListView is loaded” issue and a support incident has been created under your account to track the status of this report. Please log on to our support website to check for further updates.      

Please let us know if you need any further assistance. 
Dinesh Babu Yadav  

Russ Fustino
Replied On March 2, 2017 06:52 AM UTC

I got to tell you, your samples and Forum solutions are excellent. Thank you for taking the time to do such quality work. And I am very happy to hear SfListView is completely developed with UI Virtualization(Item recycling) concept. Excellent. I modified the sample you provided to start with a navigation page so I can easily differentiate between app load time and navigating to a page with the list view. I  an I am seeing decent response time on this sample. On my 7inch Kindle Fire running I am running Fire tablet OS , I am seeing 4 second load time and 1 second reload. Similar results on my HP 10 Plus inch tablet running Android version 4.4.2 4 second load, 2 second reload . When I run my own app on the Kindle I am seeing about the same timings. However, I am seeing about 6 second on the HP for load and 2 second for reload. The 6 second load is a bit much. I am using .png in my app, does that make a difference in Android vs .jpg like you have in the example? That is about the only difference I can pick out easily. I have been doing these timings in debug mode, so I am guessing release mode will be even better. Any other ideas for tweaks on the performance here? On another note, I read where in Android you need to dispose of the image as it will not be disposed of automatically which will lead to memory problems. Is that an issue here with prolonged image use or do you dispose of properly in this sample or does the item recycling take care of that?  Keep up the great work! Much appreciate.

Attachment: ListViewSampleWithNavigation_519ce377.zip

Dinesh Babu Yadav [Syncfusion]
Replied On March 3, 2017 03:38 PM UTC

Hi Russ, 
We are analyzing the reported issue “Improving the loading performance in SfListView with images” at our end and we would like to let you know that we are updating the binding context of the ListViewItem only and we are unable to disposing the native objects while reusing the items. We need some more time to validate this issue with Xamarin Profiler to check the memory leak while scrolling the images and will update the further information on or before March 8, 2017. 
Please let us know if you require further assistance. 
Dinesh Babu Yadav 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon