Re: ideas on improving the performance of gtk_tree_view



Hi,

Lainaus Federico Mena Quintero <federico ximian com>:

> El jue, 29-03-2007 a las 17:43 +0300, markku vire iki fi escribió:
> 
> > Using arrays in GtkTreeDataSortHeader doesn't appear to be optimal,
> > because their length is not constant. We would end up to 
> > alloc/dealloc/copy sequence when adding new items. 
> 
> >From a quick look at the code, the only place where
> _gtk_tree_data_list_header_new() gets called is from
> gtk_list_store_set_n_columns(), which is an internal construct-time
> function.  So the number of headers cannot change.
> 

Wouldn't it be possible that calling gtk_tree_sortable_set_sort_func
with some strange sort_column_id causes _gtk_tree_data_list_set_header 
to append new items to header list? At least it contains the code 
to create new items.

> > However, why this step is needed at all for each comparisison!! 
> > It's certainly the case that there will be more sort function calls 
> > than changes to sort criteria. This would allow us to cache the pointer 
> > to active GtkTreeDataSortHeader directly, providing us constant time 
> > O(1) access. Or did I miss something?
> 
> Oh, you are completely right!  You could indeed cache the "current"
> header and only refresh it when the sort_column_id changes.
> 
> Who's got a patch burning a hole in their pocket? :)

I made my first try :) There is now a new bug in bugzilla to follow 
the patches related to this matter: http://bugzilla.gnome.org/show_bug.cgi?id=430095

-Markku-



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