When you have a lot of data to display in a Control
such as a ListView
, you need some way of virtualizing the Nodes
created and used. Otherwise it will affect the memory footprint and consequently the time.
For example, if you have 10 million data items, you don’t want to create 10 million Nodes. So you create enough Nodes to fill the display dynamically and reuse them as the user scrolls through the ListView
control.
From documentation:
Because TreeView, ListView, TableView and other such controls can
potentially be used for displaying incredibly large amounts of data,
it is not feasible to create an actual Cell for every single item in
the control. We represent extremely large data sets using only very
few Cells. Each Cell is "recycled", or reused. This is what we mean
when we say that these controls are virtualized.
P.S : every framework has this kind of virtualization, be it Android, WPF , JavaFX etc.
From one of the developers of JavaFX:
http://fxexperience.com/2009/09/ui-virtualization/
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…