Summer vacation means much faster thumbnail viewer.

August 16, 2010

I've just returned from one week of vacation on Zakynthos in Greece, and the result is the same as every year of summer vacation - a lot of time to spent on KPhotoAlbum :-)

This year I rewrote the thumbnail viewer from the old Q3IconView to Qt4's QListView, and while I was at it (and yes that was really my starting point), I optimized the loading of thumbnails quite a bit. We are talking about orders of magnitude here!

The technical details - in case you care

Just prior to my vacation I experienced with storing thumbnails in one large file, which is much faster to load than storing each thumbail in a file of their own. See the details in my blog

This is what I do now, but that really only contribute to a minor part of the speed up, it turned out that thumbnails was scaled when loaded from the cache - at the time that seemed like a good idea, but the result was that each thumbnail costed an extra 10 msec - which amounts to a whole second for 100 thumbnails. Now the images in the cache has the actual size needed. This means that it is flushed each time you resize the thumbnail - so stop doing that a lot :-)

Another slowdown was the drawing of the 3D effect around each thumbnail. By changing that from drawing 5 rectangles to drawing 5 filled rectangles, I got a huge speedup :-)

What are the catch?

So is this all great, no catch?, well there is a few minor ones.

What are the advantages?