[cairo] Performance analysis of a Cairo application
Dan Amelang
daniel.amelang at gmail.com
Thu Oct 18 14:38:53 PDT 2007
Hi Ivan,
On 10/17/07, Ivan Baldo <ibaldo at adinet.com.uy> wrote:
> Hello.
> I want my (under development) application to run faster, so I want
> to know where most of the time is spent to focus this optimization effort.
> ...
> Instead I am getting things like this:
> 1% main()
> 99% draw()
> 50% drawThings1()
> 50% drawThings2()
> Thats because both functions have equal complexity on my code, but I
> know that actually drawThings1 is using Cairo in a way that it is slower
> for Cairo or my graphics card to process than drawThings2.
And how do you know this?
The Right Thing To Do is use oprofile to get global, system-wide
profiles what will contain performance information for both your
application code, cairo, and the X server. That should be all you
need, don't worry about the work your graphics card is doing. It's
unlikely that your graphics card is involved in the bottleneck, in
fact, on many (most?) systems today, the graphics card isn't doing
that much to accelerate cairo (yet).
So you want to find out what your CPU is spending its time doing, and
oprofile is the way to get that.
Dan
More information about the cairo
mailing list