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

DataBinding with state flow performance issue #3332

Open
shamtay opened this issue Jun 20, 2022 · 1 comment
Open

DataBinding with state flow performance issue #3332

shamtay opened this issue Jun 20, 2022 · 1 comment

Comments

@shamtay
Copy link

shamtay commented Jun 20, 2022

Hello!

We are observing the performance issues in the recyclerView when at least one view of the recycler view item layout is bound with
MutableStateFlow. To bind the first row of the recyler view it takes up to 150 ms and following items some times up to 10 ms and more vs 4 ms expected. We do not observe the issue when view is bound e.g. to MutableLiveData or String, binding takes about 2ms only in that cases

We added more details (including flame chart screenshot, logcat screenshot, etc.) to the sample app: https://github.com/shamtay/StateFlowIssue

Accoriding to profiler It looks like the problem is related to job cancelling, but it is not clear why it takes significant time.

It seems likes the cancelling happens in the Main.immediate dispatcher which blocks the UI thread, so probably pushing this to the end of thread's queue might be more reasonable.

issue in the android tracker https://issuetracker.google.com/issues/236524521

@qwwdfsad
Copy link
Collaborator

qwwdfsad commented Jul 6, 2022

Thanks for the detailed report! We are looking into that, though it's quite hard to make any estimations regarding this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants