Bug 459182 - KDE filechooser hangs in directories with many images
Summary: KDE filechooser hangs in directories with many images
Status: REPORTED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (show other bugs)
Version: 5.97.0
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-15 19:53 UTC by Alex
Modified: 2023-01-24 10:34 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex 2022-09-15 19:53:15 UTC
SUMMARY
I think it is a regression, but I can't find the old bug.


STEPS TO REPRODUCE
1. Choose a image file to open (e.g. from chromium)
2. open a folder with a lot of photos

OBSERVED RESULT

3. the file chooser hangs, probably while the folder is processed in the background (thumbnails, etc.?)

EXPECTED RESULT

The file chooser should stay responsive all the time

SOFTWARE/OS VERSIONS
Operating System: Debian GNU/Linux
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.4
Graphics Platform: X11
Comment 1 Nate Graham 2022-09-16 00:35:40 UTC
Does it happen when you access the same location in other apps using the KDE file dialog, or just Chromium? How about Gwenview?

Also are affected apps installed from distro packaging, or Flatpak or Snap or something else?
Comment 2 Alex 2022-09-16 10:08:34 UTC
It also happens with kdialog --getopenurl
I think it is a bit different from the bug before, as it does not hang completely.

- The file list changes quite some time after opening the dialog
- I can select a file (when I am fast enough while the list still changes) and the name gets into the name field
- I can scroll, but it stutters
- clicking open doesn't react right away. I think it doesn't wait for the sorting/thumbnailing? to finish completely, but it certainly seems to wait for some pause/thread change or similar

When thumbnails are active, I get quite a few messages about files with issues in the terminal, e.g.

qt.gui.icc: fromIccProfile: failed minimal tag size sanity
libpng warning: iCCP: known incorrect sRGB profile
Corrupt JPEG data: 1 extraneous bytes before marker 0xdb

which are probably rather harmless warnings from the thumbnailer and should at most result in a broken thumbnail.

But when disabling thumbnails, I still get a list that changes for a few seconds, a stuttering interface and a progress bar with 0% in the lower left (Isn't that for the thumbnails?) and the list itself is responsive (with small stutters) after it stopped changing after 2-3 seconds, but clicking the open button takes another 3 seconds.

The filesystem is BTRFS.
Some numbers about the image folder and how fast simple command line tools are:

$ ls|wc -l
27875

find -type f|wc -l
45651

$ time ls -t >/dev/null 
real	0m0,045s
user	0m0,011s
sys	0m0,034s

$ time ls -tR >/dev/null 
real	0m0,075s
user	0m0,020s
sys	0m0,055s
Comment 3 Nate Graham 2022-09-19 03:11:16 UTC
Thanks for the info!
Comment 4 Oliver Beard 2023-01-24 10:20:24 UTC
I also have this issue. The dialog can be slow to open as well, but sometimes (rarely) pressing the save button doesn't leave the dialog hung for ages and it closes immediately. I wonder if this is specifically relating to folders with many images, or just folders with many files in general. The issue here is seen with folders with about ~10k files, sizes ranging from 100 to 1000 KiB.
Comment 5 Alex 2023-01-24 10:34:03 UTC
It is at least not directly a filesystem issue. My folder has about 30k images and that's easy to handle for most programs.