Version: Revision 816682 (using Devel)
Installed from: Compiled sources
I've noticed that if the pager is active, plasma use about 30-40% of CPU when I quickly move windows. I'm using 4 desktop and twinview with nvidia drivers.
I've closed the pager widget and the CPU use is less than 2% when moving windows.
Probably repainting the windows on the pager consume too much CPU.
to me it usually the cpu doesn't go so high, but the problem seems to exists.
the problem doesn't seem to be in the paint stuff rather than in recalculateWindowRects()
the problem is that when a window moves all the window geoms for all desktops are calculated again from scratch..
I've noticed that resizing a window, doesn't use so much CPU, it use about 15-20% of CPU.
yes, each desktop area should be painted independantly. this will result in smaller repaints, and was how we did it in kde3.
calculating window geoms is cheap, painting is not.
Created attachment 25143 [details]
Increase update delay to decrease pager cpu usage
I dont have a clue how to solve this problem properly. Somebody has to find out
how to check which windows were changed. As a quick fix I have just increased
the update delay to 1 sec. This way i just uses up to 2% for me.
aaron: hmm, but paintinterface always gets the whole applet rect, is there a wai to repaint only a piece without having the rest erased? i tried that but the other desktops always gets totally black
christian: i would use this anyways, i see that half a second decreases the usage very much already...
.5s makes it look completely jumpy, as if it can't keep up for some reason. not good.
> is there a wai to repaint only a piece without having the rest erased
void QGraphicsItem::update ( const QRectF & rect = QRectF() )
which implies doing some bookkeeping in pager to tell which desktop needs repainting.
the Easy(tm) way is to make each desktop a separate QGraphicsItem, really.
Created attachment 25166 [details]
update a single desktop
don't know if i got this right: the desktop where the window changed tracked by
m_dirtyDesktop and then the update done only on his rect
Created attachment 25167 [details]
update a single desktop ..updated
oh, kwindowinfo::desktop() seems to return -1 sometimes that caused crashes,
this adds more checks
I don't think the current patch will work with windows that are on all desktops.
no, this will work just fine with windows on all desktops. such windows return -1 (or, more properly, NET::OnAllDesktops, which is defined as -1) and so this will set the value of dirty desktop to -1 and update the entire pager (which is correct).
Marco: looks good.
I've just recompiled KDE, now moving windows make plasma use not more than 25% of CPU, but only for some istants... the performance is improved since some days ago.
SVN commit 818842 by mart:
keep track in what desktop a window was moved and repaint only that
raise the update interval to half a second
these two things saves a lot of cpu
M +30 -2 pager.cpp
M +1 -0 pager.h
WebSVN link: http://websvn.kde.org/?view=rev&revision=818842