-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Stats Period Details: Optimize table view updates by integrating diffable data source #22823
Stats Period Details: Optimize table view updates by integrating diffable data source #22823
Conversation
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
|
TODO: Requires the same fix #22857 Edit: Done ✅ |
… source apply methods Usage of performBatchUpdates is not allowed if table view depends on a diffable data source and can result in crashes
When I run this on my phone, Stats feels sluggish. I haven't checked
It's hard to tell if it's due to the debug build or an actual issue with the app. I'm leaving this as a partial review to come back to. |
Thanks for testing! Yes, we should be careful with performance, especially given that the goal if this task was to optimize Stats. I'll check later myself to see which operations could be making Stats sluggish and maybe there're some flaws in this implementation. |
I can reproduce the same thing when the iPhone is connected to a debugger. Both on the
Without a connected debugger,
|
…w-updates-by-integrating-diffable-data-source
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking @staskus!
I re-tested with the feature flag on and off by going through all the Traffic detail screens and found no issues. It's not very easy to see the difference this PR makes because of the other performance issues that are unrelated to this PR. Even after disconnecting the debugger, the back button is very slow at times (~5 seconds to respond), but it might also have to do with it being a debug build.
I think this is good to merge because the diffable data source is the way forward 👍
Fixes #22720
Related PRs:
Description
Introduce diffable data source into Stats Details (Traffic -> Details, Days/../Years -> Details) views. I only found 2 ViewControllers used for Stats Details:
PostStatsTableViewController
to show Stats for a PostSiteStatsDetailTableViewController
for all the other Details viewsSolution
ImmuTableViewHandler
toImmuTableDiffableViewHandler
diffableDataSource.apply
instead of settingtableViewModel
tableViewSnapshot
instead oftableViewModel
Hashable
To test
Test with both
Stats Traffic
feature flag enabled and disabled:Traffic
orDays/../Years
tabRegression Notes
Breaking Stats Details views
Manual testing
None
PR submission checklist:
RELEASE-NOTES.txt
if necessary.Testing checklist: