Merge lp:~vanvugt/compiz-core/fix-946887 into lp:compiz-core

Proposed by Daniel van Vugt
Status: Merged
Approved by: Alan Griffiths
Approved revision: 3040
Merged at revision: 3043
Proposed branch: lp:~vanvugt/compiz-core/fix-946887
Merge into: lp:compiz-core
Diff against target: 23 lines (+2/-4)
1 file modified
plugins/opengl/src/paint.cpp (+2/-4)
To merge this branch: bzr merge lp:~vanvugt/compiz-core/fix-946887
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
Review via email: mp+95864@code.launchpad.net

Description of the change

Avoid pointlessly doing a full copy of a linked list every frame when the
copy is never changed and never different to the source. This cuts an
instant 6-9% from compiz' CPU usage (LP: #946887)

To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

LGTM (I'd prefer moving the "rit" declaration to the point of initialization too.)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/opengl/src/paint.cpp'
2--- plugins/opengl/src/paint.cpp 2012-02-27 03:53:45 +0000
3+++ plugins/opengl/src/paint.cpp 2012-03-05 09:46:24 +0000
4@@ -217,9 +217,6 @@
5 GLMatrix vTransform;
6 CompPoint offXY;
7
8- CompWindowList pl;
9- CompWindowList::reverse_iterator rit;
10-
11 unredirectFS = CompositeScreen::get (screen)->
12 getOption ("unredirect_fullscreen_windows")->value ().b ();
13
14@@ -234,7 +231,8 @@
15 count = 0;
16 }
17
18- pl = cScreen->getWindowPaintList ();
19+ const CompWindowList &pl = cScreen->getWindowPaintList ();
20+ CompWindowList::const_reverse_iterator rit;
21
22 if (!(mask & PAINT_SCREEN_NO_OCCLUSION_DETECTION_MASK))
23 {

Subscribers

People subscribed via source and target branches