Bug 486956 - Dolphin takes ≥5s to load ≈ 52 GiB, 7x10^3-file directory when group column is shown
Summary: Dolphin takes ≥5s to load ≈ 52 GiB, 7x10^3-file directory when group column i...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 24.02.2
Platform: Fedora RPMs Linux
: NOR minor
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL: https://discuss.kde.org/t/dolphin-str...
Keywords: regression
Depends on:
Blocks:
 
Reported: 2024-05-13 12:52 UTC by Roke Julian Lockhart Beedell
Modified: 2024-05-15 10:41 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:
4wy78uwh: performance+


Attachments
Depiction of the problem. (277.49 KB, video/mp4)
2024-05-13 12:52 UTC, Roke Julian Lockhart Beedell
Details
`.perfParser` file from Hotspot. (919.70 KB, application/x-xz)
2024-05-13 16:29 UTC, Roke Julian Lockhart Beedell
Details
View Display Style Preferences (64.67 KB, image/png)
2024-05-13 16:54 UTC, Roke Julian Lockhart Beedell
Details
Flamegraph (503.35 KB, image/png)
2024-05-15 10:41 UTC, Roke Julian Lockhart Beedell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roke Julian Lockhart Beedell 2024-05-13 12:52:58 UTC
Created attachment 169438 [details]
Depiction of the problem.

SUMMARY
Dolphin takes ≥5s to load ≥52 GiB, 7x10^3-file directory. I've been informed that this is far below the expected threshold of size for such slowness.

STEPS TO REPRODUCE
Enter the directory.

OBSERVED RESULT
Dolphin takes ≥ 5s to render its contents.

EXPECTED RESULT
The aforementioned size shouldn't noticeably affect Dolphin.

SOFTWARE/OS VERSIONS
Operating System: https://download.fedoraproject.org/pub/fedora/linux/releases/40/Spins/x86_64/iso/Fedora-KDE-Live-x86_64-40-1.14.iso
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Kernel Version: 6.8.9-300.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 7600X 6-Core Processor
Memory: 30.5 GiB of RAM
Graphics Processor: AMD Radeon RX 5700
Manufacturer: ASRock
Product Name: X670E Taichi

ADDITIONAL INFORMATION
https://discuss.kde.org/t/dolphin-struggles-to-load-directories-contain-many-files/15450/6?u=rokejulianlockhart
Comment 1 Roke Julian Lockhart Beedell 2024-05-13 13:00:15 UTC
The `perf.data` file is available at https://wim.nl.tab.digital/s/B5Ptt4qN2CdtYNP
Comment 2 Roke Julian Lockhart Beedell 2024-05-13 15:06:26 UTC
(In reply to Roke Julian Lockhart Beedell from comment #1)
Redacted due to uselessness, per https://discuss.kde.org/t/dolphin-struggles-to-load-directories-which-contain-many-files/15450/8?u=rokejulianlockhart
Comment 3 Roke Julian Lockhart Beedell 2024-05-13 16:25:21 UTC
(In reply to Roke Julian Lockhart Beedell from comment #2)
Flamegraph is available at https://discuss.kde.org/t/dolphin-struggles-to-load-directories-which-contain-many-files/15450/12?u=rokejulianlockhart. If I can export a proper flamegraph, I'll attach it to this bug.
Comment 4 Roke Julian Lockhart Beedell 2024-05-13 16:29:20 UTC
Created attachment 169448 [details]
`.perfParser` file from Hotspot.

This allows me to retroactively view the performance data, so it might work for you, too.
Comment 5 Méven Car 2024-05-13 16:50:09 UTC
The flamegraph showed the process spend way too much time retrieve group name for the files.

This is a regression from:
https://invent.kde.org/frameworks/kio/-/merge_requests/1276
b1a0a7cfe704db2a0aa363fed4e03501f324df9e
Comment 6 Méven Car 2024-05-13 16:52:40 UTC
This is easily reproducible in dolphin, simply show the user group column with a moderate to high number of files.
Comment 7 Roke Julian Lockhart Beedell 2024-05-13 16:54:50 UTC
Created attachment 169449 [details]
View Display Style Preferences

(In reply to Méven Car from comment #6)
Comment 8 Roke Julian Lockhart Beedell 2024-05-13 16:55:47 UTC
(In reply to Roke Julian Lockhart Beedell from comment #7)
Indeed, disabling that fixes it for me.
Comment 9 Bug Janitor Service 2024-05-14 05:00:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1630
Comment 10 Méven 2024-05-15 06:25:48 UTC
Git commit a360462d5290200b27d874d1cb3895336942d55b by Méven Car.
Committed on 15/05/2024 at 06:05.
Pushed by meven into branch 'master'.

kfileitem: cache group names

Since b1a0a7cfe704db2a0aa363fed4e03501f324df9e the group name is now
fetch in KFFileItem, it was previously fetched inside the file
kioworker.

Cache the group names in KFileItem using a thread local QMap.

M  +9    -1    src/core/kfileitem.cpp

https://invent.kde.org/frameworks/kio/-/commit/a360462d5290200b27d874d1cb3895336942d55b