[cairo] Performance analysis of a Cairo application

Ivan Baldo ibaldo at adinet.com.uy
Wed Oct 17 13:54:48 PDT 2007

    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.
    For that, I need to know the slow functions of my application based 
on total time spent not on that particular function but all the 
functions it calls, inside or outside my application, even libraries, X, 
    I tried gprof and oprofile, but it seems that they don't give the 
data I need, they show the time spent inside my application but not 
counting the time waiting for the Cairo calls (that in turn wait for X 
and in turn waits for the graphics card to draw the things).
    So suppose I have a couple of simple functions called 
"drawThings1()" and "drawThings2()" that doesn't do much processing 
their selfs but calls a lot of Cairo functions, and a main function 
called "draw()".
    I would like a call-graph that says something like this:

    1% main()
99% draw()
    70% drawThings1()
    30% drawThings2()

    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.

    So, how do Cairo users benchmark their applications?


Ivan Baldo - ibaldo at adinet.com.uy - http://ibaldo.codigolibre.net/
ICQ 10215364 - Phone/FAX (598) (2) 613 3223.
Caldas 1781, Malvin, Montevideo, Uruguay, South America.
We believe that we are free, but in reality we are not! Are we?
Alternatives: ibaldo at codigolibre.net - http://go.to/ibaldo

More information about the cairo mailing list