[cairo] Performance of the image surface back-end

Nicholas Allen nick.allen at onlinehome.de
Sat Aug 16 01:15:49 PDT 2008

Hash: SHA1

Vladimir Vukicevic wrote:
> On Aug 15, 2008, at 6:20 AM, Nicholas Allen wrote:
>> Cairo (image surface back-end version 1.6.4 on Windows):
>> ~     DrawHorizLine                 44352 ms             1000000 solid
>> horiz lines from 0.5, 50.5 to 500.5, 50.5
> This is not actually a pixel-aligned horizontal line, unless you are  
> using the non-default SQUARE endcaps.  The horizontal line would be  
> from 0.0, 50.5 to 501.0, 50.5.  With this line, you are getting  
> essentially the slowest possible path for path rasterization; however,  
> even with that, it seems quite slow.  As others mentioned, seeing the  
> source for your benchmark would be useful!  (If, however, you are  
> explicitly setting SQUARE endcaps, then something is likely going  
> quite wrong.)

Thanks for pointing out that error. At the moment I am just trying to
get something to profile and not that draws correctly. If this 0.5
offset can slow a line down by factors of a hundred or so then I would
say this indicates some serious problems with the line capping code.

The line has a width of 1 pixel and a length of 500 pixels. If the
drawing of the line caps (which I guess can only be a max of 2 pixels)
is causing such a huge overhead (it would have to be hundreds of times
more than drawing the other 498 pixels) then the end caps must be
extremely inefficient. Actually I have not set an explicit line cap
style so it will be using the default one - I'm not sure what that is. I
am at home now and so can't try this to see what difference it makes but
will let you know on Monday.

I have already posted the source for my benchmarks to this list so if
you can see anything obviously wrong with my benchmarking or Cairo
binding code I would appreciate any feedback.



Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the cairo mailing list