<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=741044422-23042008><FONT face=Arial size=2>While profiling a
test app I did with Cairo (mostly scaled up/down and rotated blitting), I
noticed a LOT of time is spent fetching and storing pixels in Pixman. I had a
look and implemented a small optimization that substantially reduces the number
of fetching calls needed. This optimization works well especially in the
cases of scaled up blitting and bilinear filtering, as we'll be often requesting
the same pixels many times in a row. There's no point in fetching them
again.</FONT></SPAN></DIV>
<DIV><SPAN class=741044422-23042008><FONT face=Arial size=2>In my test app,
blitting an image 11 times ranging linearly between scales of 1.0 to 3.0
(while rotating 10 degrees each time), this patch goes from 18.6 million calls
of fbfetch down to 10 million.</FONT></SPAN></DIV>
<DIV><SPAN class=741044422-23042008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=741044422-23042008><FONT face=Arial size=2>I'm attaching here
my patch, along with some benchmark results. <SPAN
class=741044422-23042008><FONT face=Arial size=2>The performance gains go up to
about 3X.</FONT></SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=741044422-23042008><FONT face=Arial size=2><SPAN
class=741044422-23042008></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN class=741044422-23042008><FONT face=Arial size=2><SPAN
class=741044422-23042008>I'm still looking into further optimizing
fetching/storing calls.</SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=741044422-23042008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=741044422-23042008><FONT face=Arial
size=2>Best,</FONT></SPAN></DIV>
<DIV><SPAN class=741044422-23042008><FONT face=Arial
size=2>Antoine</FONT></SPAN></DIV></BODY></HTML>