Re: ideas on improving the performance of gtk_tree_view



On Thu, Mar 22, 2007 at 07:44:57PM +0100, Nicolas Setton wrote:
> I'm not sure I understand this part: should I use a gtk_table to  
> display this kind of data? What is the preferred way to display this  
> kind of information (5000 columns x 50 rows) in Gtk+? The GtkTreeView  
> seemed the best approach to me.

You want to use a sheet widget, which is unfortunately not in GTK+ at
the moment (we should really have one at some point...).  There are
some "third-party" sheet widgets around, for example GtkExtra has one
(http://gtkextra.sourceforge.net/).

> Moreover, the GtkTreeView 'almost' supports this, so I think it would  
> be a shame to simply throw down our weapons so soon! See below for  
> suggestions.

It would almost support displaying the data, but getting the behavior of
a proper sheet widget right in GtkTreeView is a lot of work and would
make the GtkTreeView even more complex, which is something I am not
looking forward too.  Then you also want to have a two dimensional data
model instead of tree view's row-based one, etc.  I think this really
belongs in a separate widget.

> This gives me an idea.
> 
> Proposal (1): we give the user the possibility (through a property,  
> for instance) to deactivate keyboard navigation, in exchange for an  
> enormous gain of performance for big trees.

I don't think introducing a property to deactivate keyboard navigation
is a good idea; I absolutely do not want to go there.

> Proposal (2): we give the user the possibility to tell the tree view  
> that the only way the data will change is through the model. When the  
> tree view is guaranteed this, it executes the loop on  
> gtk_tree_view_column_cell_set_cell_data only once in each model  
> change, and not once in every expose.

You need to run gtk_tree_view_column_cell_set_cell_data() in every
expose for every row to be rendered.  Cell renderers can only hold the
data for a single row.  (And note that it is being called twice for each
row in every expose right now because of the reused cell renderer/key
navigation issue raised elsewhere in this thread).


I appreciate the time you took to do some profiling and think about
this; but unfortunately both ideas will not work.


regards,

-kris.



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