Fw: Fwd: [Qt bugreports] Updates for QTBUG-75585: Massive performance regression in QML Date object

Martin Höller <martin-RZb/AGe+/[email protected]> Tue, 22 Sep 2020 09:56:11 +0200
Newsgroups gmane.comp.kde.kimdaba
Message-ID <20200922095611.3959057a@linux-du93>
Mail was meant to go to mailinglist...

--- Begin forwarded message: ---

Date: Tue, 22 Sep 2020 08:56:49 +0200
From: Martin Höller <martin-RZb/AGe+/[email protected]>
To: Johannes Zarl-Zierl <[email protected]>
Subject: Re: [KPhotoAlbum] Fwd: [Qt bugreports] Updates for QTBUG-75585: Massive performance regression in QML Date object


Hi!

Just to add some ideas...

Am 21. Sep. 2020 schrieb Johannes Zarl-Zierl:
[...]
> My conclusion to the referenced discussion was that a proper solution would be 
> to add timezone info to the database. A not quite correct solution that could 
> be good enough is probably to convert everything to UTZ.
> For the current issue, we would need UTZ data only in the database.
> 
> So simple solution would be to convert to UTZ and be done with it.  

If times are stored in UTC we could consider not saving it as a string
representation that would have to be parsed (e.g. "2012-08-16T12:01:09")
but as (milli)seconds since epoch (e.g. "1345118469"). Parsing a simple
number is much faster than parsing a date-string.

We did that in project an thus saved quite a huge amount of parsing time
on each load (we had several 100 millions of timestamps).

> I still think that the proper solution to the problem would be to add real 
> timezone support (in the future, more and more cameras will come with EXIF 
> 2.31) and having proper timezone info will allow us to retain local time for 
> display.  

I too think, that's the way to go. But I would save it as a separate,
additional attribute in XML.

While we are at it: it would probably be nice to have the opportunity so
show photo-times as "local time" or as "time taken". You know i looks
strange, when you see some midnight party photo and KPA says it was taken
at 15:07:21 because you are in a different timezone when looking at the
photo.

> Given that a generic solution in QDateTime seems unlikely, why not implement a 
> wrapper that does the caching? This would not be all that different from our 
> approach with DB::FileName. Just don't call it QuickTime ;-)  

This could be a good approach.

Another approach might be to use some primitive type like qint64
internally (which allows for quick comparison) and only convert it to a
QDateTime when needed (e.g. for formatted output).

But I really don't know the KPA code, so this might be a lot of work or
even not suitable for this case.

Just my 2¢,
- martin

_______________________________________________
KPhotoAlbum mailing list
[email protected]
https://mail.kdab.com/mailman/listinfo/kphotoalbum
signature.asc (application/pgp-signature, 181 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAl9prhsACgkQYJf22JPx7tm0EgCeJQq3vVPDbVBv6EevUBwq6DPG
w38AniTvIFnkfggKWbm7QmQaxf3WER5V
=hn3J
-----END PGP SIGNATURE-----