My project is a commercial project I cannot post here, but the code procedure is:
- GetAll(LINQ)
- filtering(Linq)
- pass IEnumerable result to RecyclerView Adapter
- Adapter convert IEnumerable<> to List<>
- Adapter Inflate the ItemCards
Big performance impact on #4, it takes up to 3 seconds on about 3k items.
How can I reduce the performance impact?
I noticed if I just create a new List<>(3000)
, it also takes about 1.5 seconds.
Or should I just not use the List?
How is Adapter fetching data by [position] if we don't use List<>.
How to go to particular Item in IEnumerable
ElementAt()
gives my app totally died when inflate. It seems to do ToList()
at every Items.