Re: Experimental cairo port



On 05/30/2012 07:07 AM, John Stowers wrote:
>> On the negative side though it is almost a magnitude of order slower. This is
>> especially noticeable if many datapoints are drawn like in the rulers example.
>> A simple solution I've tried is to filter the points and skip points which
>> wouldn't be visible anyway, because they are identical to their predecessor.
>> Part of the problem though is that cairo requires a function for each point
>> which should be drawn. This results in a huge overhead, so another solution
>> would be to use a cairo image surface and implement our own drawing functions
>> and do raw pixel access.
> 
> This is really great.
> 
> Perhaps it is worth asking on the cairo mailing list for performance
> advice - do you have a trace/oprofile run showing where time is spend
> drawing?
> 

For dot graphs part of the problem seems to be the per dot overhead. Sending
the dots to cairo using cairo_rectangle(...) (Note cairo_rectangle, doesn't
do any drawing) takes longer than drawing them with gdk_rectangle(...). The
drawing itself by calling cairo_fill(...) afterward is reasonably fast. And
in fact a `perf` report with and without the cairo_fill looks similar. The
top function is always the internal function which is called by
cairo_rectangle. With drawing it takes about 10% of the overall execution
time, without about 20%.

- Lars


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]