[Lazarus] testing virtual TListView in gtk2

Paul Ishenin ip at kmiac.ru
Wed Dec 2 04:53:38 CET 2009


Andrew Haines wrote:

> I did a small test loading a text file with 50,000+ lines with my custom
> model and the GtkTreeView retrieved the value of each item in the list
> on startup. I assume it's to calculate the size for the scrollbar since
> the height of the listitems is not fixed but can vary per row in the
> GtkTreeView.
> 
> Would this help virtual treeview in any way?

For virtual listview it is not needed to store any items anywhere - we 
only need to tell to treeview that we have 50,000+ items and return 
correct listitem when it is requested by index. Yes, it would help to 
store less data.

At the moment data is stored:
- our own structure which we want to represent in the listview
- gtk list model items - we are storing there 50,000+ items * 3 
(checkbox, glyph, index) = 50,000+ * 9+ bytes = 450,000++ bytes

If we can remove gtk list then we of course save some memory.

Best regards,
Paul Ishenin.





More information about the Lazarus mailing list