Re: TreeView performance question




On May 3, 2005, at 10:40 PM, ofey aikon wrote:

One of my widgets has a treeview (using a ListStore) which needs to
get completely rebuilt based on some user event. I was doing some
profiling on the code and realised that a lot of time is being spent
in the Gtk2::ListStore::clear call.

I wrote a stripped down version of the code (attached) which purely
clears the model and rebuilds the model based on two button clicks.
Here is the profiler output on that script. (after a few clear and
re-populate calls)

clear() is very fast on my machine. populate has a noticeable lag, but clear merely repaints.


Any other tips on speeding up the script will be appreciated too.

when performing mass alterations on a model, you can bypass a lot of screen update queueing and the like by disconnecting the view from the model.

    $treeview->set_model (undef);
    mangle ($model);
    $treeview->set_model ($model);

fixed-height mode can speed up the view, if all the rows should have the same height.


--
"Quit hittin' yourself!  Quit hittin' yourself!"
   -- Elysse, playing with a newborn baby.




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