[digikam] [Bug 478722] New: Application slowdown due to large trash

Tim Besard bugzilla_noreply at kde.org
Tue Dec 19 12:24:19 GMT 2023


https://bugs.kde.org/show_bug.cgi?id=478722

            Bug ID: 478722
           Summary: Application slowdown due to large trash
    Classification: Applications
           Product: digikam
           Version: 8.2.0
          Platform: Homebrew (macOS)
                OS: macOS
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: digikam-bugs-null at kde.org
          Reporter: tim.besard at gmail.com
  Target Milestone: ---

Created attachment 164288
  --> https://bugs.kde.org/attachment.cgi?id=164288&action=edit
profile samples during application slowdown

I've been a happy user of Digikam for many years, currently using it from a M3
macOS laptop with a local database and pictures on my NAS (Synology, SMB,
2.5Gbe link). Over the past couple of months though, I had been noticing a
gradual slowdown of Digikam during basic file management tasks (moving
pictures, creating albums, or even just expanding trees in the UI).

After finally being sufficiently annoyed, I decided to profile the application
during one of the operations grinding the application to a halt (where it got
stuck for 5-10s). The relevant bits, out of a 5s sample:

4273 QTreeView::resizeColumnToContents(int)  (in QtWidgets) + 67  [0x110b12903]
  4273 QTreeView::sizeHintForColumn(int) const  (in QtWidgets) + 637 
[0x110b1335b]
    4273 QTreeViewPrivate::widthHintForIndex(QModelIndex const&, int,
QStyleOptionViewItem const&, int) const  (in QtWidgets) + 174  [0x110b0ea9e]
      4273 ???  (in libdigikamgui.8.2.0.dylib)  load address 0x10a2dc000 +
0x227529  [0x10a503529]
        4273 QStyledItemDelegate::sizeHint(QStyleOptionViewItem const&,
QModelIndex const&) const  (in QtWidgets) + 106  [0x110ae125a]
          4273 QStyledItemDelegate::initStyleOption(QStyleOptionViewItem*,
QModelIndex const&) const  (in QtWidgets) + 498  [0x110ae0e42]
            4273 ???  (in QtWidgets)  load address 0x110925000 + 0xb65af 
[0x1109db5af]
              4273 QSortFilterProxyModel::data(QModelIndex const&, int) const 
(in QtCore) + 99  [0x111eb34f5]
                4273 Digikam::AbstractAlbumModel::data(QModelIndex const&, int)
const  (in libdigikamgui.8.2.0.dylib) + 397  [0x10a4ea79d]
                  4273 Digikam::AlbumModel::albumData(Digikam::Album*, int)
const  (in libdigikamgui.8.2.0.dylib) + 472  [0x10a4f2bb8]
                    4273
Digikam::AbstractCheckableAlbumModel::albumData(Digikam::Album*, int) const 
(in libdigikamgui.8.2.0.dylib) + 291  [0x10a4f0903]
                      4273
Digikam::AbstractCountingAlbumModel::albumData(Digikam::Album*, int) const  (in
libdigikamgui.8.2.0.dylib) + 614  [0x10a4edd06]
                        4273
Digikam::AbstractAlbumModel::albumData(Digikam::Album*, int) const  (in
libdigikamgui.8.2.0.dylib) + 400  [0x10a4ea970]
                          4273
Digikam::AlbumModel::decorationRoleData(Digikam::Album*) const  (in
libdigikamgui.8.2.0.dylib) + 72  [0x10a4f2728]
                            4273
Digikam::AlbumThumbnailLoader::getAlbumThumbnailDirectly(Digikam::PAlbum*)  (in
libdigikamgui.8.2.0.dylib) + 271  [0x10a51660f]
                              4273
Digikam::AlbumThumbnailLoader::getStandardAlbumIcon(Digikam::PAlbum*,
Digikam::AlbumThumbnailLoader::RelativeSize)  (in libdigikamgui.8.2.0.dylib) +
133  [0x10a5144d5]
                                4273 Digikam::Album::countTrashAlbum() const 
(in libdigikamgui.8.2.0.dylib) + 411  [0x10a505ceb]
                                  4273 QDir::count() const  (in QtCore) + 20 
[0x111e5694a]
                                    4273 ???  (in QtCore)  load address
0x111d95000 + 0xc19b7  [0x111e569b7]
                                      4273 QDirIterator::next()  (in QtCore) +
21  [0x111e5b175]
                                        4261 ???  (in QtCore)  load address
0x111d95000 + 0xc58cb  [0x111e5a8cb]
                                        ! 4260 ???  (in QtCore)  load address
0x111d95000 + 0xc5a78  [0x111e5aa78]
                                        ! : 4260 ???  (in QtCore)  load address
0x111d95000 + 0xc5dd6  [0x111e5add6]
                                        ! :   4260 QFileInfo::isHidden() const 
(in QtCore) + 80  [0x111e5fcf8]
                                        ! :     2203 ???  (in QtCore)  load
address 0x111d95000 + 0xfe5b3  [0x111e935b3]
                                        ! :     | 2184 ???  (in QtCore)  load
address 0x111d95000 + 0xff420  [0x111e94420]
                                        ! :     | + 2184
CFURLCopyResourcePropertyForKey  (in CoreFoundation) + 96  [0x7ff8164ce9cd]
                                        ! :     | +   2181
_FSURLCopyResourcePropertyForKeyInternal(__CFURL const*, __CFString const*,
void*, void*, __CFError**, unsigned char)  (in CoreServicesInternal) + 266 
[0x7ff819883b8b]
                                        ! :     | +   ! 2181
prepareValuesForBitmap(__CFURL const*, __FileCache*, _FilePropertyBitmap*,
__CFError**)  (in CoreServicesInternal) + 380  [0x7ff819887427]
                                        ! :     | +   !   2174
corePropertyProviderPrepareValues(__CFURL const*, __FileCache*, __CFString
const* const*, void const**, long, void const*, __CFError**)  (in
CoreServicesInternal) + 932  [0x7ff819887830]
                                        ! :     | +   !   : 2174 __getattrlist 
(in libsystem_kernel.dylib) + 10  [0x7ff8163e01ce]
                                        ! :     | +   !   :   2174 ???  (in
<unknown binary>)  [0x7ff8a699ea78]

I'll attach a couple of full samples, each 5s long, taken during various
operations that made the UI hang. The common factor in each of these is the
call to `countTrashAlbum`, and indeed, I did have significant trashes on each
of my libraries. Even better, clearing them all out made the application really
snappy again!

That said, I wouldn't ever have thought about large trashes being the culprit
of this slowdown. It's possible that there's compounding factors (the code
being transpiled by Rosetta or other macOS inefficiencies, the fact that my
libraries are on a NAS, etc), but nonetheless it feels like there's something
to optimize here.


SOFTWARE/OS VERSIONS

Digikam: 8.2.0, installed using homebrew
macOS: 14.2, M3 Pro
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.11

-- 
You are receiving this mail because:
You are watching all bug changes.



More information about the kde-mac mailing list