Summary: | Moving windows with pager active use a lot of CPU | ||
---|---|---|---|
Product: | [Plasma] plasma4 | Reporter: | FiNeX <finex> |
Component: | general | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
Increase update delay to decrease pager cpu usage
update a single desktop update a single desktop ..updated |
Description
FiNeX
2008-06-05 11:07:17 UTC
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 desktop raise the update interval to half a second these two things saves a lot of cpu BUG: 163257 M +30 -2 pager.cpp M +1 -0 pager.h WebSVN link: http://websvn.kde.org/?view=rev&revision=818842 |