home screen performance pass#690
Open
broken-droid wants to merge 20 commits into
Open
Conversation
96a8f55 to
c13c450
Compare
add RepaintBoundary wrappers around _Backdrop, and _Gradientscrim remove redudant non-null assertion
… instead of re-calculating every build added didUpdateWidget, and _invalidateStaticRowHeightCache to handle _staticRowHeightCache invalidation
wrap the Stack in _ContentRowsState build with a ValueListenableBuilder that will only build when the _scrollOffsetNotifier changes
…d active row recalculation add _activerowRecalcDistance - scroll distance gate for active row recalculation updated _ContenRowsState - _onScroll: When scrolling is happening, active row calculation is throttled instead of happening on every pixel. Active row calculation is skipped unless there's no active row yet, scroll distance has moved at least _activeRowRecalcDistance number of pixels, or user is at the top.
…edRowTargetFullScreenRows - variables to handle caching of row target offsets added _invalidateRowTargetOffsetCache - invalidate the row target offset cache added _rowTargetOffsetsForScroll - calculate the row target offsets
…to when there are real state changes
update rest of home screen to use the notifiers wrapped MediaBar related widgets and InfoArea widget in _contentRowsState - build with ValueListenableBuilders
…tifiers updated _onRowFocusTracked, _onScroll, and _buildV2ExtendedSection to update notifier instead of calling setState use a ValueListenableBuilder in _v2AdditionalRatingsByKey tied to _v2AdditionalRatingsNotifier wrapped AnimatedPadding around the _buildShiftedRow to use a ValueListenableBuilder tied to _activeFocusedRowNotifier wrapped rows in RepaintBoundary
use notifier in home screen added isScrolledToTopNotifier parameter to _ContentRows changed onScrolledToTopChanged to update the notifier instead of setState used a ValueListenableBuilder tied to _isScrolledToTopNotifier to wrap the media bar widgets
_mediaBarVisible _chromeFocusActive _chromeAudioActive _activePreviewKey _previewReady clean up setState's in _schedulePreview, _finishSharedPreview, _startSharedPreview, _moveFocusFromMediaBarToRows use ValueListenableBuilder's tied to the new notifiers, wrapping media bar and preview widgets
_isActivelyScrolling _infoRevealed clean up setState's in _revealAndScrollToPinnedInfo, _onScroll added a builder for infoPlaceholderHeight and used ValueListenableBuilder's tied to _infoRevealedNotifier added a ValueListenableBuilder around the InfoArea tied to _infoRevealedNotifier
_backdropUrl used ValueListenableBuilder tied to _backdropUrlNotifier to wrap _Backdrop
…c out of build call _updateOffsets in _onViewModelChanged, _onMediaBarStateChanged, and whenever _activeFocusedRowNotifier changes or build runs
removed RepaintBoundary's from each row, and moved it to _buildTitledRow
…RowExtents use listEquals for list comparison in _computeRowExtents change hasSubtitle to also check if not empty formatting changes
296de43 to
e004998
Compare
…w them to be focusable offscreen
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.
Summary
home screen performance improvements, cutting down on the need for widget builds and reducing build times. This reduces HomeShell and ContentRows rebuilds massively on scrolling. Most builds now will be from horizontal scrolling within the rows.
The visibility, repaintboundary's should help with gpu.
Preview player building is still something that's going to cause large build times.
Related Issues
Type of Change
Changes Made
Platform
Testing
Test Steps
1.you can try to use flutter devtools if it doesn't crash, otherwise you can add some prints to count builds, and stopwatch to measure times.
2. scroll down several rows, then back up
3. scroll horizontally in rows to get offscreen, and then back
Screenshots (if applicable)
Checklist