Re: ideas on improving the performance of gtk_tree_view
- From: Federico Mena Quintero <federico ximian com>
- To: markku vire iki fi
- Cc: gtk-devel-list gnome org
- Subject: Re: ideas on improving the performance of gtk_tree_view
- Date: Mon, 09 Apr 2007 10:45:29 -0500
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]