Bug 378625 - Very slow start
Summary: Very slow start
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Searches-Similarity (show other bugs)
Version: 5.6.0
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-10 14:41 UTC by Jānis Elmeris
Modified: 2017-05-22 12:42 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jānis Elmeris 2017-04-10 14:41:10 UTC
Both 5.5.0 and 5.6.0 pre-release version take a very long time to start up. E.g., for 800 photo album it took about 4 minutes.
There was no such problem for 5.4.0.

Gilles Caulier wrote:
> The problem is when the similarity search album are restored from database.

I tried several times to interrupt and continue the program while it was starting up. The backtraces were almost the same down to "in Digikam::FindDuplicatesAlbumItem::operator<" and with one exception including also the next one: "in QCollatorPrivate::init()". Lower than that, the rest of the lines were different in different cases.

One backtrace:

digikam.general: Added root album called:  "2017"
digikam.general: Added root album called:  "JVK"
^C
Program received signal SIGINT, Interrupt.
0x00000031e92d86f3 in ?? () from /tmp/.mount_mFKFll/usr/lib/libicui18n.so.42
(gdb) bt
#0  0x00000031e92d86f3 in ?? () from /tmp/.mount_mFKFll/usr/lib/libicui18n.so.42
#1  0x00000031e036d879 in QCollatorPrivate::init() () from /tmp/.mount_mFKFll/usr/lib/libQt5Core.so.5
#2  0x00007ffff77682d3 in Digikam::FindDuplicatesAlbumItem::operator< (this=<optimized out>, other=...)
    at /b/dktemp/digikam-v5.5.0/core/utilities/fuzzysearch/findduplicatesalbumitem.cpp:200
#3  0x00007fffef653c2c in ?? () from /tmp/.mount_mFKFll/usr/lib/libQt5Widgets.so.5
#4  0x00007fffef6547ef in ?? () from /tmp/.mount_mFKFll/usr/lib/libQt5Widgets.so.5
#5  0x00007fffef6548dc in ?? () from /tmp/.mount_mFKFll/usr/lib/libQt5Widgets.so.5
#6  0x00007fffef6507cc in ?? () from /tmp/.mount_mFKFll/usr/lib/libQt5Widgets.so.5
#7  0x00007fffef650b5f in ?? () from /tmp/.mount_mFKFll/usr/lib/libQt5Widgets.so.5
#8  0x00007fffef650c32 in QTreeWidgetItem::sortChildren(int, Qt::SortOrder, bool) () from /tmp/.mount_mFKFll/usr/lib/libQt5Widgets.so.5
#9  0x00007fffef650d06 in ?? () from /tmp/.mount_mFKFll/usr/lib/libQt5Widgets.so.5
#10 0x00007fffef648b47 in ?? () from /tmp/.mount_mFKFll/usr/lib/libQt5Widgets.so.5
#11 0x00007fffef64a649 in QTreeWidget::setItemHidden(QTreeWidgetItem const*, bool) () from /tmp/.mount_mFKFll/usr/lib/libQt5Widgets.so.5
#12 0x00007ffff7768bc7 in setHidden (ahide=true, this=0x87e6350) at ././/include/QtWidgets/qtreewidget.h:400
#13 Digikam::FindDuplicatesAlbumItem::calculateInfos (this=this@entry=0x87e6350, deletedImages=...)
    at /b/dktemp/digikam-v5.5.0/core/utilities/fuzzysearch/findduplicatesalbumitem.cpp:140
#14 0x00007ffff7768f7a in Digikam::FindDuplicatesAlbumItem::FindDuplicatesAlbumItem (this=0x87e6350, parent=0xf96980, album=<optimized out>)
    at /b/dktemp/digikam-v5.5.0/core/utilities/fuzzysearch/findduplicatesalbumitem.cpp:73
#15 0x00007ffff7766bc0 in Digikam::FindDuplicatesView::slotAlbumAdded (this=0xf95660, a=0x893c320)
    at /b/dktemp/digikam-v5.5.0/core/utilities/fuzzysearch/findduplicatesview.cpp:290
#16 0x00007ffff776cbac in Digikam::FindDuplicatesView::qt_static_metacall (_o=0xf95660, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at /b/dktemp/digikam-v5.5.0/build/core/utilities/fuzzysearch/moc_findduplicatesview.cpp:141
#17 0x00000031e04af846 in QMetaObject::activate(QObject*, int, int, void**) () from /tmp/.mount_mFKFll/usr/lib/libQt5Core.so.5
#18 0x00007ffff7751b82 in Digikam::AlbumManager::signalAlbumAdded (
    this=this@entry=0x7ffff7dd8d20 <_ZZN7Digikam12_GLOBAL__N_113Q_QGS_creator13innerFunctionEvE6holder>, _t1=_t1@entry=0x893c320)
    at /b/dktemp/digikam-v5.5.0/build/core/libs/album/moc_albummanager.cpp:583
#19 0x00007ffff7740304 in Digikam::AlbumManager::scanSAlbums (
    this=this@entry=0x7ffff7dd8d20 <_ZZN7Digikam12_GLOBAL__N_113Q_QGS_creator13innerFunctionEvE6holder>)
    at /b/dktemp/digikam-v5.5.0/core/libs/album/albummanager.cpp:1790
#20 0x00007ffff7745959 in Digikam::AlbumManager::refresh (this=this@entry=0x7ffff7dd8d20 <_ZZN7Digikam12_GLOBAL__N_113Q_QGS_creator13innerFunctionEvE6holder>)
    at /b/dktemp/digikam-v5.5.0/core/libs/album/albummanager.cpp:1263
#21 0x00007ffff7745c54 in Digikam::AlbumManager::startScan (this=0x7ffff7dd8d20 <_ZZN7Digikam12_GLOBAL__N_113Q_QGS_creator13innerFunctionEvE6holder>)
    at /b/dktemp/digikam-v5.5.0/core/libs/album/albummanager.cpp:1071
#22 0x00007ffff754f4b4 in Digikam::DigikamApp::DigikamApp (this=0x80b1b0, __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
    at /b/dktemp/digikam-v5.5.0/core/app/main/digikamapp.cpp:262
#23 0x0000000000404e7b in main (argc=1, argv=<optimized out>) at /b/dktemp/digikam-v5.5.0/core/app/main/main.cpp:201
(gdb) 

More people having the same or similar problem: http://digikam.1695700.n4.nabble.com/Dgk-5-5-very-slow-start-td4695333i20.html
Comment 1 Maik Qualmann 2017-04-10 19:57:02 UTC
Very strange, QCollator should not be called here. We sort the column with the result counter at the start. If digiKam is started and you sort the reference Image column from the duplicates search, does it take long?

Maik
Comment 2 Jānis Elmeris 2017-04-10 20:23:45 UTC
If I go to tha "Fuzzy" tab, there is nothing in "Duplicates" tab, at first.

Then I click "Find duplicates" and immediately get a "Process id done" message, and no duplicates found.

So, I cannot really sort them either. If I click on the image column header, the sorting icon (the small triangle) gets switched or toggled accordingly and without any visible delay.
Comment 3 Mario Frank 2017-04-11 12:22:06 UTC
Git commit 29ee560d14ffb22d37b85a55f9d666a116097652 by Mario Frank.
Committed on 11/04/2017 at 12:16.
Pushed by mfrank into branch 'master'.

Ignore the signal that a search album was added until the find duplicates view is active.
This is already done in fuzzy search view.
Otherwise, the automated sorting of entries is triggered which is not necessary.

Hopefully, this solves bug id 378625.

M  +17   -1    utilities/fuzzysearch/findduplicatesview.cpp
M  +1    -0    utilities/fuzzysearch/findduplicatesview.h
M  +1    -0    utilities/fuzzysearch/fuzzysearchview.cpp

https://commits.kde.org/digikam/29ee560d14ffb22d37b85a55f9d666a116097652
Comment 4 Mario Frank 2017-04-11 12:26:38 UTC
I hope that my adoptions solve the problem. Sadly, I cannot reproduce it - neither with 5.5, nor with 5.6 or current master branch.

The next AppImage will contain the adoptions.
Comment 5 Jānis Elmeris 2017-04-11 16:39:52 UTC
Unfortunately, I won't be able to confirm if this has fixed the issue or not, as today there is no more delay also with the version 5.5. Maybe opening the duplicate search and issuing the find command cleared something. I do not remember if I really did not launch digiKam after that.
Comment 6 caulier.gilles 2017-04-12 09:47:58 UTC
The new AppImage bundle 64 and 32 bits are now available in GDrive :

https://drive.google.com/drive/folders/0BzeiVr-byqt5Y0tIRWVWelRJenM

Gilles Caulier
Comment 7 caulier.gilles 2017-04-16 21:01:23 UTC
new 5.6.0 pre-release as bundle is available here :

https://drive.google.com/drive/folders/0BzeiVr-byqt5Y0tIRWVWelRJenM

Please check if this problem still reproducible with these versions.

Gilles Caulier
Comment 8 Arne Köhn 2017-04-22 15:15:33 UTC
I had the same problem and the newest appimages fixes it (for me at least).

Release 5.5: >30 min startup
5.6 pre-release: <1min startup

I hope this feedback helps and thanks for all the work!
Comment 9 caulier.gilles 2017-04-22 15:38:20 UTC
Thanks for the feedback. I close this file now.

Gilles Caulier
Comment 10 caulier.gilles 2017-05-22 12:42:28 UTC
Git commit d4ca2f4cd3ac5f0776f1159bd54aff5c9fe601ea by Gilles Caulier.
Committed on 22/05/2017 at 12:40.
Pushed by cgilles into branch 'master'.

patch from Mario Frank to reduce the time latency on startup by wiring the albumsmanager
to the find duplicates view after all albums were loaded.

M  +18   -10   utilities/fuzzysearch/findduplicatesview.cpp
M  +1    -0    utilities/fuzzysearch/findduplicatesview.h

https://commits.kde.org/digikam/d4ca2f4cd3ac5f0776f1159bd54aff5c9fe601ea