Fix Slow Event Log Scrolling for large # of events - #4175
Merged
Conversation
kenzieschmoll
approved these changes
Jun 7, 2022
CoderDake
marked this pull request as ready for review
June 8, 2022 15:36
Comment on lines
+821
to
+825
| _TableState<T> createState() => _TableState<T>(rowItemExtent: rowItemExtent); | ||
| } | ||
|
|
||
| class _TableState<T> extends State<_Table<T>> with AutoDisposeMixin { | ||
| _TableState({this.rowItemExtent}); |
Member
There was a problem hiding this comment.
never pass parameters into state objects. You can access the widget class member from the state object via widget.rowItemExtent
Contributor
Author
There was a problem hiding this comment.
this is a good life lesson thank you :)
Contributor
There was a problem hiding this comment.
I'm surprised the no-logic in createState lint didn't warn about this.
kenzieschmoll
approved these changes
Jun 8, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
Fixes #3238
It is a known issue that ListItem.builder lists can have performance issues when scrolling large lists.
The reasoning for this is that the height of each item needs to be calculated when scrolling along a list. So the list being scrolled can't just skip to the new location.
If the height of each row is the same, this performance hit can be avoided by telling the ListView the height of each row ahead of time.
This is done by setting the
itemExtent.In our case the height of each row height is the same and should be
defaultRowHeightThis also benefits the scrolling speed on the profiler page
Demos
Original Behaviour
d6idd65lgkw540ta28177tc2.mp4
Fixed Behaviour
tlxo4iyurw5c28sdchmg59av.mp4
Pre-launch Checklist
///).