Bug 384079

Summary: High CPU usage on Import when color management is enabled
Product: [Applications] digikam Reporter: Freddie Witherden <freddie>
Component: Import-MainViewAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: freddie
Priority: NOR    
Version First Reported In: 5.5.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.8.0
Sentry Crash Report:

Description Freddie Witherden 2017-08-27 16:24:28 UTC
When color management is enabled the import tool, when attempting to import NEF raw files with embedded JPEGs in the AdobeRGB color space from an SD card, becomes virtually unusable.  Specifically, a single core is pinned at 100% whenever the window has focus and there is a multi-second input lag.

Profiling with "perf" indicates that most of the wall clock time is being spent in cmsReverseToneCurveEx from liblcms2.so, which again indicates that this is related to colour management.

Once the images are imported there is no issue with CPU usage or input lag; it is only a problem in the Import dialog.  My guess is that digiKam is doing color space conversion on the fly without any kind of caching, hence the high CPU usage.
Comment 1 Maik Qualmann 2017-09-06 20:16:04 UTC
Git commit 3fe8aecccafdf0cfc41d94259dc64f43e0d3afd3 by Maik Qualmann.
Committed on 06/09/2017 at 20:14.
Pushed by mqualmann into branch 'master'.

put color managed thumbnails in the cache to reduce CPU usage drastically
FIXED-IN: 5.8.0

M  +2    -1    NEWS
M  +7    -9    utilities/importui/backend/camerathumbsctrl.cpp
M  +1    -0    utilities/importui/main/importui.cpp

https://commits.kde.org/digikam/3fe8aecccafdf0cfc41d94259dc64f43e0d3afd3