02.06.2021 12:50, Ola Fosheim Grøstad пишет:
Depends on the data, I guess, if they are all visible at once then you basically have to very carefully write your own GPU render stage for that view and carefully cache things that does not move by rendering them to buffers (in GPU memory).
Usually 1 million of items aren't visible at once. Also there is opinion that total redrawing can be more efficient than caching because of making a decision what to cache and what not can be very complex.
But if you deal with large number of items you basically can write your own view and dynamically create elements as the user scrolls. You do need to estimate the height though.
To estimate the height you need to have height of every elements, you can't dynamically create elements in that case. I create some wrapper over data set that stores height of elements. It's much cheaper and faster than creating a widget per item - that is a real advantage over retained gui. And user has access to that info - that is advantage over immediate gui. But yes, there are tasks that can/should be performed by dynamically created elements.