Closed simophin closed 3 months ago
Have tested & everything the PR touches that previously worked still appears to work, although it's difficult to quantify any performance changes without profiling.
I did notice that we're not specifying a size of the
RecyclerViewPool
and I believe the default max size is 5 (although I'm not seeing this 5 value referenced in modern docs - only in the first set of deprecated docs I came across). If we think of how many single line messages we can fit on a mobile device the number is probably closer to 13 - as such, would it be worth specifying that value as 13 viasetMaxRecycledViews
? (see: https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.RecycledViewPool)Other than that query (feel free to address as you see fit) I'm perfectly happy to approve - nice job! =D
The performance gain mainly comes from the first few enter into the conversation screen, and it's only obvious on a cheap device. I had printed out a few measurement, my Samsung used to take around 3-4 seconds to create the activity/message views and it's down to 1 second. Obviously there are still other things to do but they are much harder to do now.
Description
This PR tries to optimize some perspective of XML View loading, namely:
View
's initialization calls. (BaseActionBarActivity.getTheme()
). I tested the theme changing it still works after the change.ViewPool
toConversactionActivityV2
'sRecyclerView
.