Fix performance of SeparatedRecyclerViewAdapter.#150
Open
jonzolla wants to merge 1 commit intokebernet:masterfrom
Open
Fix performance of SeparatedRecyclerViewAdapter.#150jonzolla wants to merge 1 commit intokebernet:masterfrom
jonzolla wants to merge 1 commit intokebernet:masterfrom
Conversation
When creating the ViewHolder for a puzzle item, the adapter was iterating over every section in the adapter, inflating a layout, and keeping only the last one. I believe that this causes the time required to render the main BrowseActivity to grow quadratically with the number of sections in the BrowseActivity. For a large crossword library (several years worth) on a Pixel 2, this decreases the time to open the BrowseActivity and have a usable UI from over a minute to several seconds. The time now seems to be dominated by time required to perform the file system operations to list the puzzles.
|
Awesome! It's always been a bit slow, but going from v4.4.1 to v4.4.3 [I skipped v4.4.2], it got noticeably worse - several minutes to refresh after a download, with an ANR if I tried to click anything. Release update ASAP, please! As an aside, the ANR 'crash report' showed Shortyz using 51% of the CPU, followed by sensors.qcom at 29% (I've got a Qualcomm SoC). Is this normal? |
gaul
approved these changes
Jan 13, 2019
yourealwaysbe
added a commit
to yourealwaysbe/forkyz
that referenced
this pull request
Apr 5, 2021
Thanks to jonzolla kebernet#150
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.
When creating the ViewHolder for a puzzle item, the adapter was iterating over every section in the adapter, inflating a layout, and keeping only the last one.
I believe that this causes the time required to render the main BrowseActivity to grow quadratically with the number of sections in the BrowseActivity.
For a large crossword library (several years worth) on a Pixel 2, this decreases the time to open the BrowseActivity and have a usable UI from over a minute to several seconds. The time now seems to be dominated by time required to perform the file system operations to list the puzzles.