[KPhotoAlbum] Startup performance
Robert Krawitz
rlk at alum.mit.edu
Tue Oct 13 00:33:02 BST 2020
On 10/12/20 4:04 PM, Johannes Zarl-Zierl wrote:
> Hi Robert,
>
> A big thank you from me as well!
>
>
> Am Montag, 12. Oktober 2020, 19:19:24 CEST schrieb Robert Krawitz:
>> [...]
>> But nothing really urgent.
>
> My takeaway from this is that I should put more effort into refactoring and
> modernizing the codebase in general. I already broke a large number of
> dependencies between different parts of KPA - modularizing the core components
> (database, thumbnail storage, exif database) and adding unit-tests is not that
> much effort from here (at least it seems far more doable than a year ago).
>
> With the database code as an isolated component and with a decent test
> coverage we can start going after the not so low hanging fruit (like a cache
> for the database file).
>From a performance standpoint, the kind of refactoring I'd like to see would be something that
allows a data flow that can be parallelized, potentially both in terms of control flow and in terms
of data parallelism. So for example if one thing did nothing more than parse the images into
something that's not a full-fledged ImageInfo but is a fast representation that can be handed off to
something that creates the ImageInfo from it (and preferably the thing that creates the ImageInfo
would be completely self-contained, so the only thing left would be to insert it into the internal
database structure). That would be very convenient since those operations appear to take a
comparable amount of time. If we came up with a faster representation, then we'd really want to be
able to parallelize the creation of ImageInfo objects.
Another idea -- and I'm not quite sure how to implement it -- would be to create a very fast
serialized representation. When you save your work, it saves out the serialized representation,
then in the background it saves out the .xml file. Then when you start kpa, it somehow checks that
the .xml file matches the serialized file, and if it doesn't, it asks you what you want to do. Then
if you've manually edited the .xml file you can use that in preference to the serialized file. But
that would admittedly be a real headache to test and maintain...
More information about the Kphotoalbum
mailing list