Skip to content
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

Feature/fga/improve room detail start #4065

Merged
merged 6 commits into from Sep 23, 2021

Conversation

ganfra
Copy link
Contributor

@ganfra ganfra commented Sep 23, 2021

Try to improve performance on RoomDetail screen by:

  • Using StubView when it makes sense (most notable is InviteView)
  • Lazy asynchronous loading of EmojiData
  • Dagger lazy injection of some classes

@github-actions
Copy link

github-actions bot commented Sep 23, 2021

Unit Test Results

  34 files  ±0    34 suites  ±0   20s ⏱️ ±0s
  73 tests ±0    73 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
180 runs  ±0  180 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 9c559a7. ± Comparison against base commit 9c559a7.

♻️ This comment has been updated with latest results.


class LifecycleAwareLazy<out T>(
private val owner: LifecycleOwner,
initializer: () -> T
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not private val?

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just 2 comments. I guess you have check the the emoji completion and the Emoji screen are still working well.
Also do you have some measurement of the improvement to display a room?

return getOrInflate(inflateIfNeeded, roomDetailBinding?.inviteViewStub, this::inviteView)
}

private inline fun <reified T : View> getOrInflate(inflateIfNeeded: Boolean, stub: ViewStub?, reference: KMutableProperty0<T?>): T? {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be extracted to a more generic place

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will see if we reuse this mechanism somewhere else I guess, no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but if it is hidden here, there is less chance. Anyway, ok

@@ -43,13 +44,13 @@ import kotlin.math.abs
* TODO: Performances
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't really improve performance on this screen, so not really

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@ganfra
Copy link
Contributor Author

ganfra commented Sep 23, 2021

Yes I tested the different screens using emojis, all ok.
For the measurements, I have just ones from profiler

@bmarty bmarty merged commit 9c559a7 into develop Sep 23, 2021
@bmarty bmarty deleted the feature/fga/improve_room_detail_start branch September 23, 2021 17:35
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.

None yet

3 participants