Re: ideas on improving the performance of gtk_tree_view



El vie, 23-03-2007 a las 23:19 +0100, Michael Natterer escribi�> I would rather say we absolutely don't abuse lists here. There is no
> significant difference between list and array for a couple of items
> (say < 50 items). The only abuse I see is creating a treeview with
> 5000 columns. The widget is simply not made for that. It would be
> the same as optimizing GtkVBox for 5000 children and asking for
> the internal list being replaced by an array.

So, a few things:

* 5000 columns is definitely abusing the *user*.  Who cares about the
toolkit.

* A tree row has an immutable number of columns; their datums are of
known sizes.  This screams "array".

* An array would give you less memory overhead from allocator padding,
better cache locality, less pressure on the allocator, and constant-time
access to the columns.  I bet that it will also require less code than a
list :)

> What GTK+ needs here is a *sheet* widget, something that is optimized
> for organizing two-dimensional data in an efficient way. Hacking up
> GtkTreeView for insane use cases does no good whatsoever.

Yes, we definitely need a sheet widget.  I don't know why people don't
just write one, or revive the old one.  Maybe they are scared that it
doesn't do enough for a spreadsheet --- but people are not building
spreadsheets; they just want to display simple tabular data.

> P.S.: I do not say that optimizing treeview is a bad idea, I would
>       just find it very unfortunate to waste developer resources
>       in order to optimize use cases like this.

I'd rather not discourage people who are actually bothering to profile
our shitty code --- they don't come along very often.

  Federico




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