Skip to content

Fix performance of SeparatedRecyclerViewAdapter.#150

Open
jonzolla wants to merge 1 commit intokebernet:masterfrom
jonzolla:ui_perf
Open

Fix performance of SeparatedRecyclerViewAdapter.#150
jonzolla wants to merge 1 commit intokebernet:masterfrom
jonzolla:ui_perf

Conversation

@jonzolla
Copy link
Contributor

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.

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.
@ThatGitJer
Copy link

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?

yourealwaysbe added a commit to yourealwaysbe/forkyz that referenced this pull request Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants