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

Robert Krawitz rlk at alum.mit.edu
Sun Sep 27 01:18:15 BST 2020


On 9/26/20 4:42 PM, Johannes Zarl-Zierl wrote:
> Am Samstag, 26. September 2020, 21:25:40 CEST schrieb Robert Krawitz:
>> On 9/25/20 3:20 PM, Johannes Zarl-Zierl wrote:
>>> Am Freitag, 25. September 2020, 03:53:21 CEST schrieb Robert Krawitz:
>>>> So I've taken a crack at a FastDateTime (wrote the header file and made
>>>> the
>>>> changes elsewhere, but haven't actually implemented it).  However, it
>>>> looks
>>>> like I don't have ssh keys installed so I can't push now.
>>>>
>>>> I've attached the header file for reference.
>>>
>>> Looks good to me...
>>
>> I've opened an MR for this and assigned it to Johannes:
>> https://invent.kde.org/graphics/kphotoalbum/-/merge_requests/2
> 
> Thanks - I've taken the opportunity to try out doing a review using the gitlab 
> UI...
> 
> While reading the code in XMLDB/Database.cpp I stumbled about the following 
> comment that may be relevant to the discussion we had about adding timezone 
> information to index.xml:
> 
> ````
> // During profiling of loading, I found that a significant amount of time was 
> spent in Utilities::FastDateTime::fromString.
> // Reviewing the code, I fount that it did a lot of extra checks we don't need 
> (like checking if the string have
> // timezone information (which they won't in KPA), this function is a 
> replacement that is faster than the original.
> Utilities::FastDateTime dateTimeFromString(const QString &str) { /*...*/}
> ````
> 
> I conclude from this comment that adding timezone info will come with some 
> cost. Still, I see this as a worthwhile endeavour...

We'll have to see when we get there.  I don't think it will be too bad.  Overall, dateTimeFromString
is about 10% of the startup, but about 90% of that is the actual date/time creation.

BTW, I tried calling QDateTime::fromString() on the string rather then doing the date and time
separately; I saw no apparent difference in performance either through wall clock or kcachegrind.
So next time we touch that code we might want to try just letting the QDateTime code do its thing.



More information about the Kphotoalbum mailing list