Comment 9 for bug 940139

On Sun, 26 Feb 2012, Daniel van Vugt wrote:

> Good news. I have a working solution that drops the CompRegion overhead
> from 51% to 9% without any ABI breakage. That's an average reduction in
> compiz CPU usage of 42%!
>
> I will spend some more time testing and trying to improve it further
> before I propose it.
>

You are a hero, as usual :)

> --
> You received this bug notification because you are a member of Compiz
> Maintainers, which is the registrant for Compiz Core.
> https://bugs.launchpad.net/bugs/940139
>
> Title:
> [callgrind] compiz spends about 51% of its CPU time in CompRegion
> construction/destruction
>
> Status in Compiz Core:
> In Progress
>
> Bug description:
> I've only been profiling compiz with callgrind for a while, but the
> first thing that stands out as unusual is CompRegion. It appears to be
> such a heavily used class that compiz spends 51% of its CPU time
> constructing and destructing CompRegions...
>
> 1,173,358,129 = total execution time
> 223,504,551 = time in (and below) CompRegion::~CompRegion
> 218,441,501 = time in (and below) CompRegion::CompRegion(CompRect const&)
> 158,941,179 = time in (and below) CompRegion::CompRegion()
>
> The primary reasons for this slowness appear to be:
> (a) XCreateRegion is slow.
> (b) new/delete is too slow to be used as frequently as CompRegion uses it.
>
> Instead of fixing CompRegion itself though, we should first look at
> the call graph and see if there are any callers that dominate.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/compiz-core/+bug/940139/+subscriptions
>