[cairo] ahhh ! I think I get it ! - the fbCompositeCopyAreammx case.

Soeren Sandmann sandmann at daimi.au.dk
Fri Mar 28 07:14:21 PDT 2008


Frédéric Plourde <frederic.plourde at polymtl.ca> writes:

> And I finally understood why you get consistent, no-gain results, even as image size goes up...  (it's a very silly reason, in fact), it's because the "subimage_copy" perftest only copies a 2 X 2 area, no matter how large the image is !!  A Questionnable choice if you ask me... But I shouldn't judge this choice so harshly, whoever put it that way at first sure had good reasons, but I'll bring up this issue to cairographics very soon, of course.

But if it only copied a 2 x 2 area, why did you see such performance
gains? The copy operation would not have had any significant impact on
the time.

> To get a sense of the progression of our little fbCompositeCopyAreammx as image scales up, just change line #40 of subimage_copy.c from
> 
> cairo_rectangle (cr, 2, 2, 4, 4);
> to
> cairo_rectangle (cr, 0, 0, width, height);
> 
> ... or apply the attached patch ;-)

With that change, I do see significant performance gains in the rgb
case:

image-rgb   subimage_copy-128    0.04 0.51% ->   0.02  1.71%:  2.20x speedup
image-rgb   subimage_copy-64     0.02 0.63% ->   0.01  2.04%:  1.87x speedup
image-rgb   subimage_copy-256    0.08 0.92% ->   0.06  0.59%:  1.38x speedup
image-rgb   subimage_copy-32     0.01 1.69% ->   0.01  1.92%:  1.24x speedup
image-rgb   subimage_copy-16     0.01 2.02% ->   0.01  1.98%:  1.13x speedup

So, Vlad, feel free to push the patch, but please also make the same
change in the ABGR->XBGR case.

Thanks,
Soren


More information about the cairo mailing list