[KPhotoAlbum] More performance tuning

Dotan Cohen dotancohen at gmail.com
Sun Feb 19 12:09:18 GMT 2006


On 2/11/06, Robert L Krawitz <rlk at alum.mit.edu> wrote:
> There's another spot that I think is ripe for some performance tuning
> work: the thumbnail cache.
>
> void ThumbnailView::ThumbnailView::reload( void )
> {
>    pixmapCache().clear();
>    _selectedFiles.clear();
>    updateCellSize();
>    repaintScreen();
> }
>
> This is called out of MainView::reloadThumbnails(), which is called
> whenever the thumbnails are shown, the date range changed, images are
> reconfigured, and a few other cases.  There certainly are situations
> where the entire thumbnail cache needs to be cleared; the thumbnail
> size changing is of course one of them.  However, in many
> circumstances there's no need for the thumbnail cache to be cleared at
> all (e. g. when the date range is changed, when the thumbnails are
> displayed), and others where only a few thumbnails need to be flushed
> (thumbnails are rotated or drawn on, for example).  Even with my
> improvements there's a huge performance difference between redrawing
> cached thumbnails and loading the thumbnails to begin with.  I've
> prototyped a change whereby the pixmap cache is only cleared in some
> cases (where the thumbnail size is changed or where images are
> reconfigured) and it's a lot faster.
>
> Another optimization that might be worthwhile would be to have a
> background thread that gradually loads thumbnails whenever nothing
> else is going on.  For the common case where someone loads a large set
> of images and then gradually scrolls down this would make the
> application much snappier.
>
> --
> Robert Krawitz                                     <rlk at alum.mit.edu>
>

The way that BrilliantPhoto (my favorite photo organizer from windows)
refreshes the thumbnails cache is at program exit. This is good
because it does not get in the way of doing other things. I only
mention it because BrilliantPhoto is a great program and there are a
few lessons to be learned from it (Picasa took a lot of ideas from
it). Unfortunatly, the developer recently sold it and I do not know if
development will continue in the same direction.

Dotan Cohen
http://technology-sleuth.com/short_answer/what_is_a_router.html


More information about the Kphotoalbum mailing list