Bug 441384 - Dolphin's UI responsiveness becomes slow while counting items inside subfolders in an NTFS partition
Summary: Dolphin's UI responsiveness becomes slow while counting items inside subfolde...
Status: REPORTED
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: details mode (show other bugs)
Version: 21.08.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: efficiency
Depends on:
Blocks:
 
Reported: 2021-08-22 17:46 UTC by Eduardo
Modified: 2023-07-04 23:15 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Script to create a big folder structure (181 bytes, text/plain)
2021-08-22 17:46 UTC, Eduardo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eduardo 2021-08-22 17:46:01 UTC
Created attachment 140954 [details]
Script to create a big folder structure

SUMMARY
Dolphin's UI responsiveness becomes slow while counting items inside subfolders in an NTFS partition

STEPS TO REPRODUCE
1. Place the attached script on a writeable NTFS partition and run it. It will create a folder named 'bigfolder' with 100 subfolders, and each of them with 100 empty files.
2. Open the newly created 'bigfolder' on Dolphin, making sure the "Details View Mode" is active (Ctrl+3).
3. As soon as Dolphin opens the folder, try to resize the Dolphin window. Try to move the scrollbar. Try to drag-select a bunch of subfolders.

OBSERVED RESULT
The above operations will all feel very slow and unresponsive: Dolphin window will refresh itself at very slow fps. After around 5-10 seconds, it becomes smoothly responsive again. Pressing F5 (refresh) will trigger the bug again.


EXPECTED RESULT
Dolphin's UI should remain perfectly responsive, even if there are background tasks running, such as counting items inside subfolders.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon 5.22, Linux 5.11.0-27-generic (64-bit), Dolphin 21.08.0
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.13

ADDITIONAL INFORMATION
On my system the bug happens only on NTFS partitions, even if running on a fast SSD.

Dolphin is counting the number of items inside each of the subfolders to display in the "Size" column, which is great, but this task is slowing down the UI thread.

I understand support for NTFS file system is not native to Linux, so it is expected that the actual file system operations should not work as fast. But I believe efforts can be made inside Dolphin to at least not lock the UI thread, making sure the potentially slow tasks are running in a background thread, keeping the UI responsive all the time.
Comment 1 Eduardo 2021-08-26 17:58:12 UTC
I tested this in other environments:

Two completely different computers with KDE Neon 5.22 user edition up-to-date, the bug is triggered on both computers every time.
However, I installed Arch Linux in one of those computers, and despite having the same Dolphin/Plasma/KDE Framework version, the bug doesn't happen under Arch Linux.

The difference might be the ntfs-3g or FUSE version. This is what I have on each system:


Common versions in both systems:
# plasmashell --version
plasmashell 5.22.4
# kf5-config --version
Qt: 5.15.2
KDE Frameworks: 5.85.0
kf5-config: 1.0
# dolphin --version
dolphin 21.08.0


Difference in versions:
Under Neon (bug happens):
root@Neon:~# fusermount -V
fusermount3 version: 3.9.0
root@Neon:~# ntfs-3g --version
ntfs-3g 2017.3.23AR.3 integrated FUSE 28


Under ArchLinux (bug doesn't happen):
[root@ArchLinux ~]# fusermount -V
fusermount version: 2.9.9
[root@ArchLinux ~]# ntfs-3g --version
ntfs-3g 2017.3.23 external FUSE 29

So this may serve as clues to those who wish to investigate the bug. Or maybe it can be 'overlooked' until all distros are shipping non-bug-triggering ntfs-3g/FUSE versions.
Comment 2 dvdnet89 2021-12-31 01:59:00 UTC
My dolphin version 21.12 with kde neon and when I load the external drive with ntfs partition on it. it will become very slow to load. But, when I switch to other file managers such as nautilus or thunar. It will become really fast. So, I presume this is dolphin's problem.
Comment 3 tagwerk19 2021-12-31 14:21:12 UTC
(In reply to Eduardo from comment #0)
> EXPECTED RESULT
> Dolphin's UI should remain perfectly responsive, even if there are
> background tasks running, such as counting items inside subfolders.
For me Dolphin gives a count of the items within the subfolder, not recursively down into the whole tree. I do get a recursive count if I right click on the "bigfolder" and look at properties.

Nevertheless...

Might be worth holding out until you can test with the Paragon NTFS drivers (rather than NTFS-3G). My experience with Fedora 35, as per

    https://bugs.kde.org/show_bug.cgi?id=406506#c21

was pretty good. I tried your test script on F35 (100 folders, each with 100 empty files) in an NTFS partition and Dolphin was OK.

1000 folders, each with 1000 empty files, was a bit more of a challenge. Dolphin was OK but you could see that baloo was fighting to catch up (it needed an hour to note down the newly created files - although if you say 250 per second that doesn't sound so bad). That clearly had an impact on the system. Once the baloo_file had caught up with the new files and started to schedule the content indexing the impact was far less.
Comment 4 dvdnet89 2021-12-31 14:32:30 UTC
I use kde neon. So, I think I will get the update faster than usual KDE LTS distro and I hope this can be fixed. But, the strange thing is my current dolphin can load internal ntfs partition from Windows normally. But, the external ntfs partition from external harddrive quite slow while. I compared with other file manager such as: nautilus and thunar can load my external ntfs normally.
Comment 5 tagwerk19 2021-12-31 15:06:54 UTC
(In reply to dvdnet89 from comment #4)
> ... I think I will get the update faster than usual KDE LTS
> distro and I hope this can be fixed ...
You need to watch out for a 5.15 kernel, the new NTFS drivers come with that
Comment 6 spiesant 2022-04-10 03:28:38 UTC
Been using Kubuntu 20.04 for some time, and this issue does not exist - Dolphin is lightning fast.  Just switched over to KDE Neon, & it's orders of magnitude slower on my ntfs volume - almost unusable. This definitely seems to be a regression of some sort.

Kubuntu 20.04 info (doesn't exhibit this issue):
KDE Plasma 5.18.7
KDE Frameworks: 5.68.0
QT: 5.12.8
Kernel: 5.4.42-050442-generic
Dolphin: 19.12.3 

KDE neon 5.24 (has the issue):
KDE Plasma: 5.24.4
KDE Frameworks: 5.92.0
Qt: 5.15.3
Kernel: 5.13.0-39-generic
Comment 7 spiesant 2022-04-10 03:41:47 UTC
Addendum (this bug tracker won't let me won't let me edit my past comments...?)

Tried it with kernel 5.17.2, per a previous commentor, but the issue remains.

I'd also note that it's not just that Dolphin lags while it's populating the item counts, but that populating the counts itself is significantly slower. On Kubuntu, all subfolder item counts are populated nearly instantaneously. On KDE, in a long directory, they populate very slowly, one after the other.
Comment 8 René Fritz 2023-07-04 22:58:26 UTC
KDE neon 5.27 22.04 (x86_64)

I have the same Problem but with ext4.

It seems dolphin in kde neon has git functionality included - even when the dolphin-plugins package for git support is NOT installed.

Dolphin shows icons with git status. Directories with many git repositories take ages to count. The gui is laggy.

A folder without git repositories is faster, but not lightning fast.
Comment 9 René Fritz 2023-07-04 23:15:36 UTC
(In reply to René Fritz from comment #8)
> KDE neon 5.27 22.04 (x86_64)
> 
> I have the same Problem but with ext4.
> 
> It seems dolphin in kde neon has git functionality included - even when the
> dolphin-plugins package for git support is NOT installed.
> 
> Dolphin shows icons with git status. Directories with many git repositories
> take ages to count. The gui is laggy.
> 
> A folder without git repositories is faster, but not lightning fast.

I realised Kommit (Git gui client for KDE) was installed and caused the slow down. Which means my problem was not related to the bug report.