architecture-components-samples: Android room database - LiveData paging slow appear when a lot of insert/update into database
I’m working in a project realtime with LiveData and Paging database I meet the issue: – My list take long time to appear when have a lot of insert/update to database.
val viewModel = ViewModelProviders.of(this).get(MyViewModel::class.java) viewModel.init(database) viewModel.getUserList()?.observe(this, Observer { println("load paging :::: ${it?.size}") })
could anybody help me
Thank you so much. Hieu Tran
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 20 (2 by maintainers)
@tvhieuit Currently I’m working on a demo with Paging lib + Room + LiveData, I trigger updates and try to debug and see what’s going on. The result is Room only loads specific number of items follow what I’ve config with Paging lib (ex : page size) instead of re-create the whole query
I think that Room (+LiveData) will re-query for every updates so it’s causing slow when have a lot of insert/update