After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 94710 - Excessive number of get_value calls
Excessive number of get_value calls
Status: RESOLVED DUPLICATE of bug 80868
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.1.x
Other All
: Normal normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2002-10-02 18:54 UTC by Morten Welinder
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Morten Welinder 2002-10-02 18:54:10 UTC
For source code relating to this, see gnumeric/src/dialogs/dialog-search.c

I have equipped a GtkTreeView with a custom model in which values are
calculated on the fly.  It works but there are some problems...

1. There's no way to tell the view that the whole darn thing has changed
   underneath it.  Well, there is: delete all rows one by one and then
   insert the new ones.

2. Relatedly, there is no way to tell the view not to size all rows.
   Right now the model is initially call for all (col,row) combinations.
   It should be possible to specify "equal height" somehow.
   (==Assume that it is too expensive to evaluate all cells.)

3. When mousing over the view, the model is called a lot.  (Activate
   the g_print on line 441 to see this.)  This feels like an outright
   bug.  Actually I even see this when mousing over other parts of the
   dialog in which the view sits.
Comment 1 Morten Welinder 2002-11-05 17:46:04 UTC
Re #3: the cause appears to be expose events.  I wonder why, because
the mouse is only moved within the treeview.

Here's a sample trace.

(gdb) where
  • #0 search_get_value
    at dialog-search.c line 436
  • #1 lazy_list_get_value
    at dialog-search.c line 231
  • #2 gtk_tree_model_get_value
    at gtktreemodel.c line 880
  • #3 gtk_tree_view_column_cell_set_cell_data
    at gtktreeviewcolumn.c line 2301
  • #4 gtk_tree_view_bin_expose
    at gtktreeview.c line 2962
  • #5 gtk_tree_view_expose
    at gtktreeview.c line 3244
  • #6 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 82
  • #7 g_type_class_meta_marshal
    at gclosure.c line 514
  • #8 g_closure_invoke
    at gclosure.c line 437
  • #9 signal_emit_unlocked_R
    at gsignal.c line 2383
  • #10 g_signal_emit_valist
    at gsignal.c line 2114
  • #11 g_signal_emit
    at gsignal.c line 2148
  • #12 gtk_widget_event_internal
    at gtkwidget.c line 3132
  • #13 gtk_widget_send_expose
    at gtkwidget.c line 3027
  • #14 gtk_main_do_event
    at gtkmain.c line 1472

Comment 2 Kristian Rietveld 2002-11-05 18:18:52 UTC
Hmm, the treeview always redraws on expose events. There is not much I
can do about that.

Are you able to see if this is a synthetic expose event? There are not
enough frames in order to see that.
Comment 3 Jonathan Blandford 2002-11-05 18:26:46 UTC
The tree_view also draws when the mouse enters/exits a cell to allow
individual cells to handle prelighting.  
Comment 4 Morten Welinder 2002-11-05 18:59:06 UTC
Re-opening.  (jrb: even if I agreed that nothing should be done on #3,
that still leaves #1 and #2.)

Something really needs to be done.  This prohibitively expensive in
the common case where no pre-lighting is going on.

Currently just moving the mouse causes redraws -- think of what this
does to remote performance.  Mouse movement should be mostly a non-
event by default.
Comment 5 Kristian Rietveld 2002-11-26 22:00:02 UTC
Putting on 2.2.0 for now, just like our other optimization bugs.
Comment 6 Kristian Rietveld 2002-12-19 02:44:36 UTC
Moving remaining bugs to 2.2.1.
Comment 7 Kristian Rietveld 2003-01-22 20:18:49 UTC

*** This bug has been marked as a duplicate of 80868 ***