pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gtk3: Replaced PsppSheetView with GtkTreeView for the variables wind


From: Friedrich Beckmann
Subject: Re: gtk3: Replaced PsppSheetView with GtkTreeView for the variables window
Date: Sun, 13 Dec 2015 13:19:05 +0100

Am 13.12.2015 um 11:45 schrieb John Darrington <address@hidden>:
> On Sat, Dec 12, 2015 at 06:29:56PM -0800, Ben Pfaff wrote:
>     Looking at the commits, the biggest reason that I built PsppSheetView is
>     that GtkTreeView uses O(n) memory (and therefore time as well) for an
>     n-row treeview.  This is true even when it has fixed-height rows,
>     because it maintains a per-row red-black tree that has one node per row.
> 
> It is strange then that Friedrich's and my experiments with many variables 
> but few cases,
> did not bear this out - there must be some other factor dominating.
> 
>     (It is pretty much necessary to have some kind of data structure because
>     of the ability to have a tree rather than just a list.)
> 
> This is a shame, because of course we don't need the tree in our application.
> 
> Our current PsppSheetView was forked from GtkTreeView in Gtk2.x
> 
> I wonder if we shouldn't look at what is in Gtk3 to see if it helps us at all?

My experiments also show more a dependency on the number of columns and not
the number of rows. I did 100000 cases and 50 variables and that is o.k.

The treeview is o.k. for the more or less visible range. Is it maybe possible 
to set the number of rows and columns in the treeview just depending on the 
visible area plus some margin? Then put the treeview as a widget on a large 
canvas which represents the total data? The canvas would be scrollable and the 
position of treeview on the canvas is changed such that is always visible, but 
the data that it displays is changed according to scrolling position.

This is the existing psppire-data-sheet.c:

===============
render_data_cell (GtkTreeViewColumn *tree_column,
                  GtkCellRenderer *cell,
                  GtkTreeModel *model,
                  GtkTreeIter *iter,
                  gpointer data_sheet_)
{
  row = GPOINTER_TO_INT (iter->user_data);
  var = g_object_get_data (G_OBJECT (tree_column), "variable");

  string = psppire_data_store_get_string (store, row, var,
                                          data_sheet->show_value_labels);

==============

If the row and var would not just depend on the treeview information but also 
on the current scrolling position on the canvas, then the retrieval time would 
just depend on us and not on the treeview.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail


reply via email to

[Prev in Thread] Current Thread [Next in Thread]