Re: 'reloading' gtktreeview when model changes drastically



On Sun, 2007-08-05 at 00:32 +0200, Milosz Derezynski wrote:
> --snip--
>     void
>     Playlist_V::put_track_at_iter (Track const& track,
> Gtk::TreeModel::iterator & iter)
>     {
>       (*iter)[m_track_cr.track] = track;
>       (*iter)[m_track_cr.uid] = track.bmpx_track_id ;
>       (*iter)[m_track_cr.localUid] = m_localUid;
>       (*iter)[m_track_cr.searchKey] = track.title ?
> track.title.get() : std::string();
>       (*iter)[m_track_cr.playTrack] = track.active.get();
> --snip--
> 
> And yes, this is exactly how it looks like: The row is accessed for
> each of those lines, and each uses a separate call to list_store_set()
> internally. Yes, it i disastrous to performance. One guy on the
> gtkmm-devel list recently made a benchmark and found that the gtkmm
> way of doing this is approximately 75 times (not 75% -- 75 times)
> slower than the C Gtk+ method. 

Youch.  And I recently changed Tasks from append/set/implicit sort to
insert at index 0/implicit sort because it is visibly faster on slower
devices (as well as leading to cleaner code, no more row-inserted events
with unset data).

Ross
-- 
Ross Burton                                 mail: ross burtonini com
                                          jabber: ross burtonini com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF





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