Re: ideas on improving the performance of gtk_tree_view



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.

[Same thing for gtktreesort.c - it only creates the headers when you
change the underlying model.]

> 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? :)

  Federico




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