Summary: | Adding to the KRecentDocument::add cant take up to 100ms | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | Méven Car <meven29> |
Component: | general | Assignee: | KIO Bugs <kio-bugs-null> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | kdelibs-bugs, nate, waqar.17a |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=420504 | ||
Latest Commit: | Version Fixed In: |
Description
Méven Car
2023-04-13 09:49:33 UTC
From my profiling that I did at that time, I think the issue was that the xml file kept accumulating entries without ever removing them. So after a while the file would become large and slow down the startup of Kate. The larger the file, the slower Kate's startup. Imo, threads or daemon would be overkill for a such a simple job. Perhaps the recents list could be kept small. Otherwise it would help if a faster xml library for reading the data was used because QXml* is a disaster when it comes to performance. Checking the chat records of the discussion around this, for me the xbel file at that time was 1.9M waqar 1 Jul 23:34 /home/waqar/.local/share/recently-used.xbel which caused a 100ms slow down, per flie open (In reply to Waqar Ahmed from comment #1) > From my profiling that I did at that time, I think the issue was that the > xml file kept accumulating entries without ever removing them. So after a > while the file would become large and slow down the startup of Kate. The > larger the file, the slower Kate's startup. > > Imo, threads or daemon would be overkill for a such a simple job. Perhaps > the recents list could be kept small. Otherwise it would help if a faster > xml library for reading the data was used because QXml* is a disaster when > it comes to performance. Reducing the xml file size is one of the objective of https://invent.kde.org/frameworks/kio/-/merge_requests/1196 please review it. This might be enough to fix this bug. But It would need some measurement to confirm. (In reply to Méven Car from comment #3) > (In reply to Waqar Ahmed from comment #1) > > From my profiling that I did at that time, I think the issue was that the > > xml file kept accumulating entries without ever removing them. So after a > > while the file would become large and slow down the startup of Kate. The > > larger the file, the slower Kate's startup. > > > > Imo, threads or daemon would be overkill for a such a simple job. Perhaps > > the recents list could be kept small. Otherwise it would help if a faster > > xml library for reading the data was used because QXml* is a disaster when > > it comes to performance. > > Reducing the xml file size is one of the objective of > https://invent.kde.org/frameworks/kio/-/merge_requests/1196 please review it. > This might be enough to fix this bug. But It would need some measurement to > confirm. My plan would be to move only the trimming file size part to the daemon. This is a lot slower than adding an entry to the file. |