https://bugs.kde.org/show_bug.cgi?id=499551
--- Comment #8 from Méven <me...@kde.org> --- (In reply to Méven from comment #7) > (In reply to Andrea Ippolito from comment #6) > > Comment on attachment 178009 [details] > > flamegraph > > Very Nice that's helpful. > > > > this is while opening the context menu on a directory containing 30k 4KB > > .bin files generated with: > > > > #!/bin/bash > > > > dd if=/dev/urandom of=/tmp/file-gen/file-random-0.bin bs=4K count=1 > > iflag=fullblock > > for i in $(seq 1 30000); > > do > > cp /tmp/file-gen/file-random-0.bin /tmp/file-gen/file-random-$i.bin > > done > > You are missing some debug symbols but that's interesting already. > We can see the time is spent by the context menu plugin > slideshowfileitemaction which is part of gwenview and not enabled by default > IIRC. > > It is clearly due to: > https://invent.kde.org/graphics/gwenview/-/blob/master/app/ > slideshowfileitemaction.cpp?ref_type=heads#L49 > > There are no images in the folder and the files are of random type. > This can be optimized, it uses `db.mimeTypeForFile` which opens files when > it can't determine the mimetype by extension. That's not true it uses `QMimeDatabase::MatchExtension`. > It should use filename extension only. The optimization would be to limit the time spent in this directory scanning. If there is 1 image among 10 000 non-image files or ~275k we don't really care. > This might look a bit like an edge case, but I think KDE software should be > efficient enough to handle it, it's a situation that can happen IRL. 275K not that often. I am guessing that can happen in some research fields or development, data mining and other cases which we want to enable of course. -- You are receiving this mail because: You are watching all bug changes.