Bug 426185 - digiKam starts more slowly than previous versions
Summary: digiKam starts more slowly than previous versions
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Recognition (show other bugs)
Version: 7.2.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-04 19:21 UTC by Maik Qualmann
Modified: 2020-09-08 06:21 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.2.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maik Qualmann 2020-09-04 19:21:38 UTC
The file "/usr/share/digikam/facesengine/openface_nn4.small2.v1.t7" is loaded 10 times per RecognitionPreprocessor. A total of about 40 times at the start of digiKam. Can't we load the file once and use it multiple times?

Maik
Comment 1 Minh Nghia Duong 2020-09-04 20:01:13 UTC
(In reply to Maik Qualmann from comment #0)
> The file "/usr/share/digikam/facesengine/openface_nn4.small2.v1.t7" is
> loaded 10 times per RecognitionPreprocessor. A total of about 40 times at
> the start of digiKam. Can't we load the file once and use it multiple times?
> 
> Maik
Hi Maik,

I am intent to load an array of 10 faces extractor which contain OpenCV DNN Net object in order to accelerate batch processing. These objects can not be copied. However I fail to understand while the DNN Face recognizer is reloaded 4 times before digikam started. Could you explain why the faces management try to reload the face recognizer 4 times, please?

Nghia
Comment 2 Minh Nghia Duong 2020-09-08 03:14:28 UTC
Hi Maik,

This issue has been fixed by implementing a shared private static pointer, under commit https://invent.kde.org/graphics/digikam/-/commit/28027b21d9fa4368eb2f2ad26dbb1cb33e274cce

Nghia
Comment 3 caulier.gilles 2020-09-08 03:18:39 UTC
Thanks Nghia for your investigations and fixes. It's very appreciate.

Note: look like you can auto comments a file in bugzilla directly when you commit using "CCBUGS: _bug _number_" macro include in your commit comment. Look for ex mine:

https://invent.kde.org/graphics/digikam/commit/b5e3c5987a7380fdc5ce9a59ee5e62e6acbaf51b 

Gilles
Comment 4 caulier.gilles 2020-09-08 03:39:13 UTC
Nghia,

I confirm the fix about memory allocation at startup:

https://i.imgur.com/lQ8DcFw.png

As you can see, memory allocation at startup is really lower than before. Look also the amount of RAM available on this other VM that i use to test digiKam: only 4 Gb maximum. 

digiKam start fine as expected here. 

Maik, did you confirm ?

Gilles
Comment 5 Maik Qualmann 2020-09-08 05:50:22 UTC
Yes, great, the problem is fixed.

Maik