New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible performance issue in 3.0 #38
Comments
@kinex Do you have set the option Thanks for your help. |
Thanks for your quick response. I am not setting it to |
I think it's better to have it as |
I noticed a similar issue in my app that was using Grouped List 2.3.0, and setting the I tried updating to 3.1.0 and am getting basically the same results where if i have it set to true, it causes performance issues when scrolling. |
Upon further looking, it looks like what's happening is every time the sticky header changes (as i scroll down, if currently on "A", when the "A" tries to change to "B", which assuming is changing state) makes some child widgets in my grouped list widget rebuild. Those child widgets use provider to manage and track their state. |
I am not sure if this is related but I am using 3.1.0 with useStickyGroupSeparators set to true and two items in my list of about 50 items are swapping positions. I can see the text constantly swap between the two while I scroll. The performance is a lot better if I disable useStickyGroupSeparators but I really want it. Thanks for all of your work so far. With useStickyGroupSeparators set to false, the same two elements that were swapping positions are permanently swapped into the incorrect position. They are the 4th (index 3) and 9th (index 8) items in the 11th group (index 10). The live swapping was happening on both iOS and Android with useStickyGroupSeparators set to true, but with it set to false the permanent swap only happens on Android. Tested on 2 iOS and 2 Android devices. Edit: scratch that... it's happening on both iOS and Android. Some really odd behaviour... on each device the items are in the correct order in one orientation but if I switch the orientation of the device the items swap. |
I have the same problem, i'm using version 3.1.0. Is there a solution for it? |
I have the same problem, when useStickyGroupSeparators set to true two elements that were swapping positions. |
Version 3.2.0 has just been released. Performance issues: Items swapping: |
I still have that issue, also with the new version 3.2.0. |
@ermand-hoxha Performance Issues or the issue with the items being swapped? |
Performance issue |
I see a performance improvement, but I have a problem when the header items swapped. How to fix this? |
@allanwolski Like I mentioned this problem most likely comes from your elements not being sorted correctly. Please make sure your items are being sorted according their display value or sort them yourself and disable automatic sorting with the option |
I have created another package which depends on the scrollable_positioned_list because this was a highly requested feature. |
I've tried that Sticky Grouped List, which is very identical in setup to Grouped List, and I am still seeing performance issues on a Flutter web project. Mobile is fine, but may have the same issues, although less noticeable because it's a small render. The issue is that i have a grouped list view, and within each row (aka client), i access some state from Provider about the number of projects that client has. I notice that as i scroll down the page, and it comes to a new sticky header, it rebuilds the state or something which makes the page scroll lag because it's rebuilding the state for that count number for each row under that sticky header it just entered. Perhaps this can be fixed in this package, or perhaps I have an improvement to make in how I am handling the state, or perhaps i can tell the sticky grouped list widget to not re-build that state on that child component on each row. |
Just tested 3.2.3 and useStickyGroupSeparators is still unusable. Performance is a littler better but there is still noticeable lag when the sticky group separate is changing. The issue with items swapping still persists. The items are order correctly. New in 3.2.3, the items now swap live while scrolling when the sticky group separator is changing. This only happens with useStickyGroupSeparators set to true. It works perfectly otherwise. The sticky_grouped_list package has the exact same issues. |
@zanesc Currently I see no possibility to change the prevent the widget from rebuilding when the sticky header changes. |
@Dimibe The elements are ordered correctly. The categories are ordered by a categorySortOrder int and there are no duplicates, and the items are ordered by a sortOrder int with no duplicates within their respective categories. This isn't an issue for me as I would not be using the stickyGroupSeperators because of the noticeable lag when the sticky headers change. I haven't taken a look at your code but are you sure there is no way to separate the sticky header widget from the list widget such that only the sticky header widget rebuilds when necessary and not the list widget? Maybe @danilonogueirateixeira can shed some light on their case to confirm that their elements are ordered correctly as well. If you'd like me to I can create a new issue for this to track any other users who may be having the same issue. If I get the time I will create a project to reproduce the issue to share with you, but I can't at the moment. |
Performance issues fixed in version 3.3.0@zanesc Thank you for your detailed explanation. I released a new version 3.3.0 where the list does not rebuild when the sticky group header changes. With that I expect the performance issues to disappear. Therefore I have closed this issue. For the issue with the changing order please create a new issue if still present. It would appreciate a small example with shows the issue because I was not able to reproduce it. |
Thanks so much for fixing this! The performance is much better using 3.3.0! |
Thanks @Dimibe v3.3.0 is much better! I fixed the ordering issue by setting sort to false on GroupedListView. The only other issue I see is that the header on the list is still visible below the sticky group header which creates an overlap but I guess this was the sacrifice that you had to make in order to not rebuild the list when the header changes. |
I tried upgrading form 2.31 to 3.0. After the upgrade the parent widget where I have
GroupedListView
gets rebuilt every time I scroll the list view. In other words the widget includingGroupedListView
is rebuilt repeatedly unnecessarily. This makes the list very slow. Issue gets fixed if I revert to 2.3.1. Any ideas what could be wrong?Simplified build method where the problem occurs:
The text was updated successfully, but these errors were encountered: