Summary: | Many face tag comboboxes and may tags, will have an impact on performance [patch] | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Kristian Karl <kristian.hermann.karl> |
Component: | Faces-Workflow | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | CLOSED FIXED | ||
Severity: | normal | CC: | caulier.gilles |
Priority: | NOR | ||
Version: | 2.7.0 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 2.8.0 | |
Sentry Crash Report: | |||
Attachments: |
Sceenshot of an image with a lot of face tag combo boxes.
Don't sync if it's already performed |
Description
Kristian Karl
2012-07-24 09:07:50 UTC
Created attachment 72721 [details]
Sceenshot of an image with a lot of face tag combo boxes.
I used this image to reproduce the problem.
The problem also occurs with images with only a few face tag combo boxes on it, it only takes longer for the problem to occur.
CPU or memory usage? CPU usage. When I enabled the logging I mentioned above, I easily came to millions of calls to ModelCompletion::sync(QAbstractItemModel* model, const QModelIndex& index) [core/libs/widgets/common/modelcompletion.cpp @ line number257] Created attachment 72805 [details]
Don't sync if it's already performed
This patch fixes the performance problem. But I'm not claiming it to be a final solution, because I do not fully understand the implications or any side effects of this patch.
Git commit a9aaa60c26b03e5f0b445aa78bea97fb165ebc36 by Marcel Wiesweg. Committed on 29/07/2012 at 14:57. Pushed by mwiesweg into branch 'master'. Check that the new source model is not actually already the source model. Qt does not seem to make this test. M +9 -3 libs/models/albumfiltermodel.cpp http://commits.kde.org/digikam/a9aaa60c26b03e5f0b445aa78bea97fb165ebc36 I believe this is the problem: We have 1 set of models and n completion objects. When creating each new widget, the two filter models change their source model, which resets the model, even if there is no actual change and the source model is already set. As we share the model, adding widget x will resync all 1..x completion objects, which means we will resync n + (n-1) + (n-2) + ... times. Please check if my fix solves the problem. Yes, this solves the problem. (In reply to comment #6) > I believe this is the problem: We have 1 set of models and n completion > objects. When creating each new widget, the two filter models change their > source model, which resets the model, even if there is no actual change and > the source model is already set. As we share the model, adding widget x will > resync all 1..x completion objects, which means we will resync n + (n-1) + > (n-2) + ... times. > Please check if my fix solves the problem. |