Bug 348705 - Extreme CPU load when changing color schemes
Summary: Extreme CPU load when changing color schemes
Status: RESOLVED DUPLICATE of bug 358526
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 5.0.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Jeremy Whiting
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-04 16:10 UTC by Michael
Modified: 2016-04-06 10:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2015-06-04 16:10:02 UTC
I use three monitors yet it doesn't make sense to have such an extreme CPU load simply to change the palette. The workload spikes last about 20-30 seconds. Qt apps (e.g. Plasma) become unresponsive and do not repaint.  

https://www.dropbox.com/s/y313gasm5qh48mj/CPU.png?dl=0

Reproducible: Always
Comment 1 Jeremy Whiting 2015-08-21 02:33:08 UTC
Michael,

I've heard horror stories by others about the cpu usage of KColorScheme and it's internals. In order to recreate the issue here, could you tell me what you mean by "change the palette" ? Are you just switching from say "Default" to "Breeze" and back or are you fine tuning the color scheme? Does the spike happen when you hit apply/ok or just when the preview widget is changed based on the currently selected color scheme?
Comment 2 Michael 2015-08-26 16:49:37 UTC
Hi Jeremy - 

I meant the latter, fine tuning e.g. the color of title bars.  The spike happened after I went to apply changes, not during the preview step.

Perhaps I should try this again after Plasma 5.4 makes it through Kubuntu backports, to see if it's still a problem?
Comment 3 Jeremy Whiting 2015-08-26 18:45:09 UTC
Michael,

Yeah, maybe it will get better. I'm running plasma from git here and switching a color or two in the Colors tab then hitting apply I see a spike in one of the 8 cores on this i7 machine for a couple of seconds is all. Nothing like 20-30 seconds or plasma being unusable during that time. KColorScheme itself hasn't changed in quite a while, but maybe some of the Qt apis it uses have.
Comment 4 David Edmundson 2015-09-26 11:21:00 UTC
Kate seems to get pegged out at high CPU usage for ages, in a constant loop of:
KateRendererConfig::reloadSchema

0  0x00007f25cb9e2d10 in KateRendererConfig::reloadSchema()@plt () from /opt/kde5/lib64/libKF5TextEditor.so.5
#1  0x00007f25cbb94765 in KateRendererConfig::reloadSchema (this=0x138eb30)
    at /home/david/projects/kde5/src/frameworks/ktexteditor/src/utils/kateconfig.cpp:2290
#2  0x00007f25cbbab25d in KTextEditor::EditorPrivate::updateColorPalette (this=0x11dcdd0)
    at /home/david/projects/kde5/src/frameworks/ktexteditor/src/utils/kateglobal.cpp:458
#3  0x00007f25cbbab350 in KTextEditor::EditorPrivate::eventFilter (this=0x11dcdd0, obj=0x2a027b0, event=0x7ffd7cf08ab0)
    at /home/david/projects/kde5/src/frameworks/ktexteditor/src/utils/kateglobal.cpp:498
#4  0x00007f25c6235c9f in QCoreApplicationPrivate::sendThroughApplicationEventFilters (this=0x1112120, receiver=0x2a027b0, 
    event=0x7ffd7cf08ab0) at /home/david/projects/kde5/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1053
#5  0x00007f25c7553524 in QApplicationPrivate::notify_helper (this=0x1112120, receiver=0x2a027b0, e=0x7ffd7cf08ab0)
    at /home/david/projects/kde5/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3692
#6  0x00007f25c75534d2 in QApplication::notify (this=0x7ffd7cf0a0c0, receiver=0x2a027b0, e=0x7ffd7cf08ab0)
    at /home/david/projects/kde5/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3682
#7  0x00007f25c6235a82 in QCoreApplication::notifyInternal (this=0x7ffd7cf0a0c0, receiver=0x2a027b0, event=0x7ffd7cf08ab0)
    at /home/david/projects/kde5/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:965
#8  0x00007f25c7543b55 in QCoreApplication::sendEvent (receiver=0x2a027b0, event=0x7ffd7cf08ab0)
    at ../../include/QtCore/../../../../qt5/qtbase/src/corelib/kernel/qcoreapplication.h:224
#9  0x00007f25c754c30e in QApplicationPrivate::setPalette_helper (palette=..., className=0x0, clearWidgetPaletteHash=true)
    at /home/david/projects/kde5/qt5/qtbase/src/widgets/kernel/qapplication.cpp:1494
#10 0x00007f25c754c4c2 in QApplication::setPalette (palette=..., className=0x0)
    at /home/david/projects/kde5/qt5/qtbase/src/widgets/kernel/qapplication.cpp:1540
#11 0x00007f25b44f51c9 in KHintsSettings::slotNotifyChange (this=0x1142970, type=0, arg=0)
    at /home/david/projects/kde5/src/frameworks/frameworkintegration/src/platformtheme/khintssettings.cpp:224
#12 0x00007f25b45080c9 in KHintsSettings::qt_static_metacall (_o=0x1142970, _c=QMetaObject::InvokeMetaMethod, _id=3, 
    _a=0x7ffd7cf08e50) at src/platformtheme/moc_khintssettings.cpp:85


KHintsSettings::slotNotifyChange is only called once, reloadSchema is being called lots
Comment 5 Dominik Haumann 2016-04-06 10:59:40 UTC
That should be fixed, see bug #358526.
Commit: http://commits.kde.org/ktexteditor/8c6a18964e0c0684d5ec068e686ed41aeb0fd657

Would be nice, if you can test again (should be in current KDE Frameworks already).

*** This bug has been marked as a duplicate of bug 358526 ***