[KPhotoAlbum] Perf suggestion: build thumbnails as images are being read

Johannes Zarl-Zierl johannes at zarl-zierl.at
Mon Dec 7 21:07:28 GMT 2015

Hello Robert,

On Sunday 06 December 2015 19:50:58 Robert Krawitz wrote:
> At present, kpa scans all of the images, and then builds thumbnails in
> a separate pass.  When reading a very large number of photos (such
> they don't stay in RAM), this results in each image file having to be
> read twice.  That's somewhat time consuming for e. g. 22 GB of photos.

I think this will be tricky to pull off without major changes to KPA.

OTOH you are absolutely correct that this will probably be a relevant speedup, 
both for users with RAW workflows and for users with NFS shares.
For optimal performance, though, all file access should be bundled to a single 
pass: reading EXIF info and other metadata, recomputing checksums - this can 
also be done more intelligently, AFAIK.

> (It would be even faster if kpa could read photos directly from a
> source and place them in the image tree according to appropriate rules
> as it's reading them in.

This part should be far easier to implement: KPA just needs to look up the 
thumbnail from the freedesktop.org thumbnail store first. Writing a shell 
script that creates those thumbnails is straightforward. Bonus: dolphin and 
gwenview get the same thumbnails without further processing.

Before someone asks: yes, we still need the KPhotoAlbum thumbnail database - 
the performance of the freedektop.org degrades with a high number of 
thumbnails (having a large number of files in a single directory is quite slow 
for most filesystems).


More information about the Kphotoalbum mailing list